Emotion Control

--- title: Emotion Control subtitle: Add emotional expression to synthesized speech --- ## Overview Use the `<speechify:style>` SSML tag to control the emotion of synthesized speech: ```xml <speak> <speechify:style emotion="cheerful"> Great news! Your order has been shipped! </speechify:style> </speak> ``` Pass SSML as the `input` parameter — the API detects it automatically. <Tabs> <Tab title="Python"> ```python response = client.tts.audio.speech( input='<speak><speechify:style emotion="cheerful">Great news!</speechify:style></speak>', voice_id="george", audio_format="mp3", ) ``` </Tab> <Tab title="TypeScript"> ```typescript const response = await client.tts.audio.speech({ input: '<speak><speechify:style emotion="cheerful">Great news!</speechify:style></speak>', voiceId: "george", audioFormat: "mp3", }); ``` </Tab> </Tabs> ## Supported emotions <CardGroup cols={4}> <Card title="`angry`" icon="face-angry"> Forceful, intense </Card> <Card title="`cheerful`" icon="face-smile-beam"> Upbeat, positive </Card> <Card title="`sad`" icon="face-sad-tear"> Downcast, melancholic </Card> <Card title="`terrified`" icon="face-fearful"> Extreme fear </Card> <Card title="`relaxed`" icon="couch"> Calm, at-ease </Card> <Card title="`fearful`" icon="face-worried"> Anxious, worried </Card> <Card title="`surprised`" icon="face-surprise"> Astonished, unexpected </Card> <Card title="`calm`" icon="face-smile"> Tranquil, peaceful </Card> <Card title="`assertive`" icon="badge-check"> Confident, authoritative </Card> <Card title="`energetic`" icon="bolt"> Dynamic, lively </Card> <Card title="`warm`" icon="heart"> Friendly, inviting </Card> <Card title="`direct`" icon="arrow-right"> Straightforward, clear </Card> <Card title="`bright`" icon="sun"> Optimistic, cheerful </Card> </CardGroup> ## Tips for best results - **Match text to emotion** — "I told you not to do that!" works with `angry`, not with `cheerful` - **Keep sentences short** — shorter sentences produce stronger emotional expression - **Use punctuation** — `!` for anger/excitement, `?` for uncertainty, `...` for hesitation/sadness - **Combine with SSML** — pair emotions with `<prosody>` and `<break>` for finer control. See [SSML docs](/docs/features/ssml). ## Examples <CodeBlocks> ```xml title="Angry" <speak> <speechify:style emotion="angry">Stop it! Right now!</speechify:style> </speak> ``` ```xml title="Sad" <speak> <speechify:style emotion="sad"> I can't believe it's over... </speechify:style> </speak> ``` ```xml title="Surprised" <speak> <speechify:style emotion="surprised"> Wait, what? Are you serious? </speechify:style> </speak> ``` ```xml title="Mixed Emotions" <speak> <speechify:style emotion="cheerful"> I'm so excited to tell you about our new features! </speechify:style> <break time="500ms" /> <speechify:style emotion="calm"> Now, let me explain how they work. </speechify:style> </speak> ``` </CodeBlocks>