More articles
Higgs TTS 3 now supports text normalization and word-level timestamps
Two updates to the Higgs TTS 3 API are available today. Text normalization reads the parts of a sentence that nobody says the way they are written. Word-level timestamps return the moment each word begins and ends, so text and audio can move together.
Text normalization
Prices, dates, times, URLs and abbreviations become the words a person would say, before the model speaks them.
Word-level timestamps
Every word comes back with a start and an end time, so captions and highlights can follow the audio exactly.
Text normalization
Written text rarely says what it looks like. Normalization makes the conversion for you, expanding numbers, dates, times, currency, units, URLs, email addresses, phone numbers, abbreviations and symbols into spoken form before the model ever sees the sentence.
- $1,250.75
- one thousand two hundred fifty dollars and seventy five cents
- https://docs.boson.ai/models/overview
- https colon slash slash docs dot boson dot a i slash models slash overview
Hear it on a sentence built almost entirely out of those:
Your appointment is on Thu, Mar 3rd at 8:05 AM. The total is $1,250.75, and the balance of $89.50 is due by 5 PM on 3/17. See https://docs.boson.ai/models/higgs-tts/overview or call us at (415) 555-0142.
Normalization onenable_tn: true
Normalization offenable_tn: false
It is on by default, so this is already happening to the text you send today. Pass
enable_tn: false to turn it off. Either way, ordinary prose is spoken as written, and control tags such as <|emotion:elation|> go on shaping delivery rather than being read aloud.The normalizer works out the language on its own in Chinese, English, French, German, Hungarian, Italian, Japanese, Korean, Portuguese, Russian, Spanish, Swedish, Thai and Vietnamese. When a line is short, mixed, or in another language altogether,
tn_language takes an ISO 639-1 code and settles it.Word-level timestamps
Set
timestamps: true and every word comes back with the moment it starts and the moment it ends. Press play below. The highlight follows those numbers and nothing else, and the clock above the sentence is the pair driving it.0.00s–0.00s
The quick brown fox jumps over the lazy dog.
That is all it takes to keep words and audio together: captions that land on the beat, karaoke subtitles, a transcript that scrolls itself, a reader that follows along for someone learning to read.
Here is the response for that clip:
JSON
{"audio": "<base64-encoded audio in the requested response_format>","response_format": "wav","input": "The quick brown fox jumps over the lazy dog.","timestamps": [{ "word": "The", "start": 0.08, "end": 0.16 },{ "word": "quick", "start": 0.16, "end": 0.48 },{ "word": "brown", "start": 0.56, "end": 0.8 },...{ "word": "dog", "start": 2.48, "end": 2.96 }]}
A few things to know before you turn it on:
- Supports English, Chinese and Spanish todayMore languages are on the way. Other languages return a null timestamps field for now.
- The response is JSON, not audio bytesDecode
audiobefore writing a file; the body itself is not playable.response_formatstill chooses the audio format, and the encoded audio arrives in that format. - timestamps can come back nullWhen alignment is unavailable, for example on very short inputs.
- Arrives with the finished clipAlignment is measured across the whole take, so ask for timestamps with
streamset to false. Streaming and timestamps together return a 400timestamps_streaming_unsupported.
Get started
Text normalization and word-level timestamps are available today.
Hear it in Voice Studio
Type a sentence, pick a voice, and listen. No code required.
Voice StudioGet an API key
Create a key in Workspace and start sending requests.
Workspace API keysTell us what you make with them: contact@boson.ai.