ai newsSo., 1. Nov.
EilmeldungApple Intelligence on Qwen in China: What Developers Need to Test Before iOS 27.3

Grok TTS speech tags, tested: what <loud>, <singing> and [laugh] actually do

xAI's Grok text to speech API ( POST https://api.x.ai/v1/tts ) has 28 built-in voices, 20 languages and a set of speech tags you put straight into the text. The docs list the tags; they don't say how much each one changes. I measured a couple. The request const res = await fetch ( ' https://api.x.a

dev.toSonntag 04:02 · 01.11.1 Min. Lesezeit
Bild: dev.to

xAI's Grok text to speech API ( POST https://api.x.ai/v1/tts ) has 28 built-in voices, 20 languages and a set of speech tags you put straight into the text. The docs list the tags; they don't say how much each one changes. I measured a couple.

const res = await fetch ( ' https://api.x.ai/v1/tts ', { method: ' POST ', headers: { Authorization: `Bearer ${ process. env. XAI_API_KEY } `, ' Content-Type ': ' application/json ', }, body: JSON. stringify ({ text: ' Stand back. <loud>This is not a drill.</loud> ', voice_id: ' eve ', language: ' en ', output_format: { codec: ' mp3 ', sample_rate: 24000, bit_rate: 128000 }, }), }); const mp3 = Buffer. from ( await res. arrayBuffer ()); Enter fullscreen mode Exit fullscreen mode language also takes auto. Price is $15 per million characters (xAI pricing page, checked 2026-10-30).

Same sentence, voice Eve, English, one clip with and one without the tag. One clip each, so this is a quick check rather than a benchmark.

So <loud> is closer to "raised, urgent delivery" than a volume control: if you need a louder file, normalise it afterwards. <singing> stretches the words into a melody, which also makes the clip longer (and, on a per-character price, not more expensive).

If you want to hear the tags on all 28 voices before wiring up the API, I built a free front-end: Grok Text to Speech. The speech tag reference has a before/after sample for each group, and there are preset pages for whisper, shouting and singing. It's an independent project, not affiliated with xAI.

Quelle: dev.to (dev.to). Original öffnen