Input format#
The TTS API accepts raw UTF-8 text bytes. The backend normalizes pushed text itself, one sentence at a time, so numbers, dates, currency amounts, acronyms, and abbreviations can be pushed as-is. This page describes what that normalization does, the character set the model ends up speaking, and the SSML markup the model understands.
Pushing text#
Pass text as UTF-8-encoded bytes to push():
tts.push("Dr. Smith owed $42 to the WHO.".encode("utf-8"))
# spoken as "doctor Smith owed forty two dollars to the W H O."
What normalization does#
The backend runs these steps, in order, on the spoken text:
Step |
Example |
|---|---|
Spell out acronyms |
|
Normalize dates |
|
Numbers to words |
|
Read a leading minus as a sign |
|
Unicode normalization |
|
Collapse repeated punctuation |
|
Collapse whitespace |
multiple spaces → single space |
Remove special characters |
drops anything outside the model alphabet |
Expand abbreviations |
|
A trailing period is added when the utterance has no sentence-ending punctuation, so the synthesis pipeline has a terminal to flush on.
The minus reads as a sign only directly before a digit, at the start of the text or after
whitespace; ranges (5-10), compounds (COVID-19), and list bullets (- 5) keep the hyphen.
An all-caps token that the pronunciation dictionary knows as a word is spoken as that word rather
than spelled out, so NASA is voiced. Tokens shorter than four characters are always spelled, so
US and IT are not mistaken for the everyday words they spell.
The result uses the restricted character set the model’s phoneme dictionary operates on:
Accepted |
Examples |
|---|---|
Letters (upper and lowercase) |
|
Space |
|
Apostrophe |
|
Comma, period |
|
Question mark, exclamation |
|
Hyphen |
|
SSML markup#
The model supports a subset of SSML (Speech Synthesis Markup Language) for controlling prosody and emotion. Well-formed tags pass through normalization untouched: only the spoken text between tags is normalized. Malformed tags (an unquoted attribute value, a missing closing quote) are dropped with a warning through the SDK log callback, so one bad tag cannot abort the utterance. Tags and attributes outside the table below are passed through and ignored by the model.