Speech Synthesis Markup Language (SSML)

Control speech synthesis with markup language

SSML is an XML-based markup language for controlling pitch, rate, pauses, emphasis, and emotion in synthesized speech. Wrap your content in a <speak> tag:

<speak>Your content to be synthesized here</speak>

Escaping Characters

Transforming text into SSML requires escaping certain characters to ensure correct interpretation:

CharacterEscaped Form
&&amp;
>&gt;
<&lt;
"&quot;
'&apos;
<!-- Original: Some "text" with 5 < 6 & 4 > 8 in it -->
<speak>Some &quot;text&quot; with 5 &lt; 6 &amp; 4 &gt; 8 in it</speak>

An attribute value we do not recognise is ignored, not refused: a misspelled emotion or level synthesizes as ordinary speech and still returns 200. Malformed XML is different - unbalanced tags or undeclared entities return 400. Check the spelling of an attribute value if a tag seems to have had no effect.

Supported SSML Tags

The prosody tag controls the expressiveness of synthesized speech by manipulating pitch, rate, and volume.

<speak>
This is a normal speech pattern.
<prosody pitch="high" rate="fast" volume="+20%">
I'm speaking with a higher pitch, faster than usual, and louder!
</prosody>
Back to normal speech pattern.
</speak>

Parameters

pitch
string

Adjusts the pitch of speech delivery.

Values:

  • x-low, low, medium (also default), high, x-high
  • Percentage adjustments: -83% to +100% (e.g., +20%, -30%)
rate
string

Alters speech speed.

Values:

  • x-slow, slow, medium (also default), fast, x-fast
  • Percentage adjustments: -50% to +9900% (e.g., +20%, -30%)
volume
string

Controls speech loudness.

Values:

  • silent, x-soft, soft, medium (also default), loud, x-loud
  • Decibel adjustments: Number with dB suffix (e.g., -6dB)
  • Percentage adjustments: -100% to +900% (e.g., +20%, -30%)

The break tag controls pausing between words, following W3 specifications.

<speak>
Sometimes it can be useful to add a longer pause at the end of the sentence.
<break strength="medium" />
Or <break time="100ms" /> sometimes in the <break time="1s" /> middle.
</speak>

Parameters

strength
string

Specifies pause strength.

Values:

  • none: 0ms
  • x-weak: 250ms
  • weak: 500ms
  • medium: 750ms
  • strong: 1000ms
  • x-strong: 1250ms
time
string

Specifies pause duration (0-10 seconds). A single break is capped at 10 seconds, and the total silence one document may insert is capped at 30 seconds - past that, further pauses are dropped rather than rejected.

Values:

  • Milliseconds: ms suffix (e.g., 100ms)
  • Seconds: s suffix (e.g., 1s)

The emphasis tag adds or removes emphasis from text, modifying speech similarly to prosody but without setting individual attributes.

<speak>
I already told you I <emphasis level="strong">really like</emphasis> that person.
</speak>

Parameters

level
string

Specifies emphasis level.

Values:

  • reduced
  • moderate
  • strong

The sub tag replaces pronunciation for contained text, following W3 specifications.

<speak>
For detailed information, please read the <sub alias="Frequently Asked Questions">FAQ</sub> section.
</speak>

Parameters

alias
stringRequired

Specifies text to be spoken instead of enclosed text.

The speechify:style tag controls emotion of the voice. See Emotion Control for the full list of 13 supported emotions and best practices.

<speak>
<speechify:style emotion="cheerful">Great news! Your order shipped!</speechify:style>
</speak>

Parameters

emotion
string

Sets the voice emotion. Values: angry, cheerful, sad, terrified, relaxed, fearful, surprised, calm, assertive, energetic, warm, direct, bright.

Examples

<speak>Welcome to SpeechifyAI Build.</speak>