What text-to-speech is and how it turns words into sound
A text-to-speech system, usually shortened to TTS, takes ordinary written text and produces spoken audio. That's the whole job.1
Knowing what happens in between helps you know what to listen for when a voice says something oddly.
The two halves
A typical system has a front-end and a back-end. The front-end deals with the text. The back-end makes the sound.1
Front-end: getting the text ready
The front-end first rewrites symbols such as numbers and abbreviations as written-out words. This step goes by several names, including text normalization.1
Next it works out how each word should sound. The source calls this text-to-phoneme conversion. A phoneme is one distinct sound in a language.1
It also marks where phrases, clauses and sentences begin and end, so the voice knows where a pause or a change in pitch belongs.1
Back-end: making the sound
The back-end takes that sound-and-rhythm plan and turns it into audio. It's often called the synthesizer.1
Where it goes wrong
The front-end has to guess in several places. It has only your text to go on. Three the source gives are below.
- Words spelled the same but said differently. One example from the source is "My latest project is to learn how to better project my voice". The word appears twice, with two different pronunciations.1
- Numbers. The same digits can be read in several ways, and the system often infers the reading from the words around them.1
- Abbreviations. The source points out that "St" in one address can stand for both "Saint" and "Street", and that some systems give the same result every time.1
If your script has a street address, a price or a product code, listen to the audio before you send it anywhere. Don't assume the guess was right.
What you actually type in
Some tools accept two kinds of input. One is plain text. The other is SSML, a markup that lets you add instructions such as where to pause. Amazon Polly's documentation, for example, describes its speech request as taking "plain text or SSML".2 There's a page on what SSML is if you want to go further.
Some tools also let you pick a voice engine. In Polly's case, if you don't pick one, the standard engine is used.2 Other makers set their own defaults, so check the documentation for the tool you're using. The difference between the engine types is covered in neural voices compared with older voices.
A habit worth building
Read your script aloud yourself first, slowly, and mark anything a stranger might say wrongly: names, codes, abbreviations, dates. Those are the lines to check in the audio. If one comes out wrong, fixing names and terms walks through the usual remedies.
Where the facts come from
- Speech synthesis, Wikipedia
- SynthesizeSpeech, Amazon Polly documentation