Voice AI Day is baaaaack! 🎙️ 11 cities, 10 Dec
    Video5:42by Voice AI Space

    How Text-to-Speech Works, Step by Step

    How text becomes speech: text normalization, letters to phonemes, prosody and the sound wave, plus the newer token and noise-refining models.

    Part of Voice AI Explained. See every episode, in learning order, in How Voice AI Works: A Complete Guide.

    Summary

    How Text-to-Speech Works

    A voice is a sound wave stored by computers as a stream of numbers. Text-to-speech (TTS) technology converts written text into these numerical streams to produce human-like speech.

    The Classic Four-Step Recipe

    1. Text Normalization: This step cleans up the text by converting written shortcuts, symbols, and abbreviations into fully written words (such as converting "$200" to "two hundred dollars"). Context is used to resolve ambiguities like "Dr." (Doctor or Drive). Common problem areas include phone numbers, prices, dates, and email addresses. Solutions include pre-formatting the text or using Speech Synthesis Markup Language (SSML).
    2. Letters to Sounds (Phonemes): Written letters are translated into phonemes, which are the distinct sounds of a language. Because spelling is often inconsistent (as in "though," "through," and "tough"), systems rely on pronunciation dictionaries, rules, or small models to determine the correct sounds. Some modern models skip this step and learn directly from letters.
    3. Prosody (Rhythm and Melody): This step plans the rhythm, pitch, pauses, and emphasis of the speech. Since a single sentence can be spoken in many different ways (the "one-to-many" problem), models predict the duration, pitch, and volume of each sound. Punctuation plays a critical role here, with commas indicating pauses and question marks altering the melody.
    4. Making the Sound Wave: Traditional systems generate the final audio in two parts: an acoustic model creates a spectrogram (a visual representation of the sound), and a vocoder converts that spectrogram into an actual sound wave. Newer end-to-end models can generate the sound wave directly from text or phonemes in a single network.

    Alternative Modern Approaches

    • Speech as Tokens: Some models treat speech like a language. A neural codec compresses audio into discrete tokens (codes representing sounds), and a language model predicts the next token in the sequence, similar to how text-based chatbots predict the next word. While highly expressive and capable of voice cloning from short samples, these models can occasionally hallucinate, repeat, or skip words.
    • Noise-Refining: Another family of models generates speech by progressively refining random noise into structured audio, similar to how AI image generators work. Many open-source models mix language models, codecs, and noise-refining techniques.

    Streaming and Latency

    For interactive voice agents, minimizing the "time to first audio" is crucial. To achieve this, TTS systems stream audio, playing the first words of a response while the rest of the sentence is still being generated. While processing text in smaller pieces reduces latency, it can result in a loss of context and unnatural melody jumps at the seams. Advanced systems use techniques like continuations to maintain context across streamed segments.

    Testing TTS Systems

    Before selecting a TTS model for a voice agent, it is recommended to conduct several tests:

    • Test the model using your own text, specifically including your product names, numbers, dates, and addresses.
    • Measure the "time to first audio" for both typical and slow responses.
    • Listen to long replies to ensure the voice remains consistent throughout.
    • Inquire about how the model was trained, including the source data and whose voices were used.

    Full transcript

    How would you read this out loud? Half? January second? February first? One of two? You'd decide from context without even thinking. A text-to-speech model has to make that call too, every time.

    The voice you're hearing is one: an open model called Kokoro. Today, part one of two: how text-to-speech turns text into a voice.

    Voice AI Space makes honest videos to help developers and curious people upskill in voice AI.

    A voice is a sound wave. A computer stores it as numbers, thousands every second. A standard phone line uses eight thousand per second. The model you're hearing makes twenty-four thousand. So text-to-speech, or TTS, has to turn a few words into a stream of numbers that sounds like a person.

    The classic recipe has four steps: clean up the text, turn letters into sounds, plan the rhythm, then make the sound wave. Newer models often blur these steps. They're still the best map.

    Step one: text normalization. Turning written shortcuts into words. A dollar sign and two hundred becomes two hundred dollars. The same two letters, D and R, can mean Doctor, or Drive. This is where voice agents often trip: phone numbers, prices, dates, order codes, email addresses.

    Two fixes: format the text yourself before you send it. Or, if your provider supports it, use SSML, a W3C markup standard. For example: read this as a date.

    Step two: turn letters into sounds, called phonemes. English has around forty-five, depending on the accent. Spelling doesn't help. Though, through, tough: the same four letters, three different sounds.

    Many systems look words up in a pronunciation dictionary, and guess the rest with rules or a small model. Context matters too. I will read it. I have read it. Same spelling, two sounds.

    Names are the classic trap. The voice you're hearing once got a product name wrong. We fixed it by respelling it. Many providers offer the same fix: a pronunciation dictionary, or phonetic spelling.

    Some models skip phonemes and learn from letters directly: Google's Tacotron 2 did in 2017, and F5-TTS does for English today.

    Step three: prosody. The rhythm, pitch, pauses and emphasis of speech. You're coming. You're coming? Same words, different melody, different meaning.

    And any sentence can be said in many good ways. Researchers call this the one-to-many problem. So models predict it. FastSpeech 2, for example, predicts how long each sound lasts, how high, and how loud.

    That's why punctuation matters. A comma is often a pause. A question mark changes the melody.

    Step four: make the sound. Classic systems do it in two parts. First, an acoustic model draws a picture of the sound, a spectrogram: time left to right, low sounds at the bottom, high at the top. Then a vocoder turns that picture into the actual wave.

    In 2016, DeepMind's WaveNet sounded very natural, but built the wave one number at a time. Slow. In 2020, HiFi-GAN did it more than a hundred times faster than real time, on one GPU.

    Some models, like VITS, go from text to wave in a single network. Kokoro, the voice you're hearing, works this way too: phonemes in, sound wave out, with just eighty-two million parameters.

    In 2023, Microsoft's VALL-E made a second approach famous: treat speech like a language. A neural codec compresses audio into tokens: small codes, like words for sound. Then a language model predicts the next audio token, the way a chatbot predicts the next word.

    VALL-E learned from sixty thousand hours of speech, and could copy a voice from a three-second sample. These models can be very expressive. But like chatbots, they can hallucinate: skip words, repeat them, or keep going. Newer versions target exactly that.

    A third family, like F5-TTS, refines random noise into speech, like image generators do. Many open models mix these ideas. Orpheus uses a language model and a codec. Chatterbox and CosyVoice use a language model, then the noise-refining step.

    For voice agents, a key number is time to first audio: how long until the caller hears something. So TTS streams. It starts playing the first words while the rest is still being made. It also receives text in pieces, as the language model writes the reply.

    Smaller pieces start faster. But each piece has less context, and the melody can jump at the seams. Some systems keep context across pieces. Cartesia calls these continuations. CosyVoice 2 streams text in and audio out at the same time.

    Before you pick a TTS for your agent, test it on your own text. Your product names. Your numbers. Your dates and addresses.

    Measure time to first audio, for typical calls and for the slow ones.

    Listen to long replies: does the voice stay consistent?

    And ask how it was trained: on what data, and with whose voices.

    Next, part two: data, training and voice cloning. TTS moves fast, and this video will age. If we got something wrong, tell us: corrections get pinned. And you'll find text-to-speech products, sorted by role, in the Voice AI Space library.