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

    How TTS Models Are Trained

    Where TTS training data comes from, how much is needed (24 hours to a million hours), how raw audio is cleaned, and how voice cloning fits in.

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

    Summary

    Data Sources and Requirements

    Text-to-speech (TTS) models learn from recordings of real people paired with the exact words spoken. There are four main sources for this training data, each with distinct trade-offs:

    • Studio recordings: Clean and high-quality, but costly to produce.
    • Audiobooks: Public domain options exist (such as LibriVox), but the speech often sounds like reading.
    • Internet speech: Natural but messy, and subject to licensing restrictions.
    • Synthetic speech: Generated by other TTS models; cheap but offers less variety.

    The volume of training data required varies by the model's goals. A classic model can be trained on about a day of audio (around 24 hours) for a single voice. Multi-voice models like Kokoro use a few hundred hours, while larger, more flexible models require significantly more data, ranging from 95,000 hours (F5-TTS) to a million hours (CosyVoice 3).

    Data Cleaning Pipeline

    Raw internet audio must undergo a rigorous cleaning process before it can be used for training. Using the Emilia pipeline as an example, the steps include:

    1. Standardize: Converting every file into a single format.
    2. Separate: Removing background noise and music.
    3. Diarize: Splitting the audio based on who is speaking.
    4. Segment: Cutting the audio into short clips of 3 to 30 seconds.
    5. Transcribe: Generating text from the audio using speech-to-text tools.
    6. Filter: Removing clips with incorrect languages, poor sound quality, or unusual speaking speeds.

    This cleaning process is highly selective; in tests, less than a third of the raw audio survived the pipeline.

    The Training Loop

    Training is an iterative loop performed on GPUs:

    • The model reads the text of a clip and makes a guess at the sound.
    • The guess is compared to the real recording, and the difference is calculated as the loss.
    • The model's internal weights are slightly adjusted to minimize this loss.
    • This process is repeated millions of times. A portion of the data is held out and never trained on to test the model's performance on unheard audio.

    Model Recipes and Voice Cloning

    Models predict sound using different approaches. The classic recipe predicts a spectrogram (a picture of sound) and may train a vocoder against a critic network to detect generated audio. The language model recipe uses a speech tokenizer to convert audio into tokens, predicting the next token. Many language-based models build upon existing text models that already understand language.

    To handle multiple voices, models use a speaker embedding, which acts as a numerical fingerprint for a voice. Models can have a fixed set of voices or support cloning. Zero-shot cloning copies a voice from a few seconds of audio without extra training, while professional cloning fine-tunes the model on longer samples (ideally two or more hours) and typically requires a consent check.

    Evaluation and Ethical Considerations

    After training, models are evaluated using human listeners, speech-to-text transcription to calculate the Word Error Rate, and speaker recognition models to assess voice similarity. Because data sourcing raises legal and ethical questions, some models incorporate inaudible watermarks to identify generated speech. Before selecting a TTS model, users should evaluate where the data came from, whether the speakers consented, if commercial use is permitted, and what safeguards exist against unauthorized voice cloning.

    Full transcript

    Every AI voice you've heard learned from recordings of real people. Which recordings? How many hours? And did anyone say yes? The voice you're hearing, Kokoro, learned from a few hundred hours of audio for about a thousand dollars of rented GPU time. Some newer models learn from a million hours. Today, part two of two: how a text-to-speech model is trained.

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

    Training data for TTS is simple: short audio clips, a few seconds each, and for every clip, the exact words spoken. From thousands or millions of these pairs, the model learns how text becomes sound. The pairs must match. If they don't, the model learns the mistake.

    Where does it come from? Four main places. One: studio recordings. People read scripts in a quiet room. VCTK, for example: 110 English speakers, about 400 sentences each. Two: audiobooks. The classic LJSpeech dataset is one LibriVox volunteer reading old books: twenty-four hours, public domain. Three: internet speech, like podcasts and interviews. Emilia has over a hundred thousand hours in six languages. Four: synthetic speech, made by other TTS models. Kokoro used some. Each has a trade-off. Studio audio is costly. Audiobooks sound like reading. Internet speech is natural, but messy, and it comes with licenses. Synthetic speech is cheap, but less varied.

    How much data do you need? It depends on the goal. One voice, reading clearly: about a day of audio, like LJSpeech, can train a classic model. Kokoro, with 54 voices in 8 languages, used a few hundred hours. Bigger, more flexible models use far more. F5-TTS, ninety-five thousand hours. Orpheus, over a hundred thousand. Chatterbox, half a million. CosyVoice 3, a million. But hours only help if they're clean.

    Internet audio can't be used as it is. The team behind Emilia published their cleaning pipeline: convert every file to one format, remove music and background noise, split the audio by who's speaking, cut it into clips of three to thirty seconds, transcribe every clip with speech-to-text. Yes: speech-to-text helps build text-to-speech. Then drop clips in the wrong language, with poor sound quality, or with an odd speaking speed. In their test on six hundred hours of raw audio, less than a third survived.

    Now, the training itself. It's a loop. The model reads the text of a clip, and makes its best guess at the sound. The guess is compared with the real recording. The gap becomes a score, called the loss. Then the model's internal numbers, its weights, are nudged slightly to shrink that gap. Repeat, a huge number of times, on GPUs. In its paper, F5-TTS ran over a million rounds on eight GPUs, for more than a week. Some clips are kept aside, never trained on, to test the model on audio it hasn't heard. And many companies don't publish what their training cost.

    What the model guesses depends on the recipe from part one. In the classic recipe, it predicts the spectrogram, the picture of sound, and learns by comparing pictures. The vocoder often trains against a critic: a second network that tries to spot generated audio. HiFi-GAN works this way. In the language model recipe, a codec or speech tokenizer first turns audio into tokens. Then the model learns to predict the next audio token. Many start from a text model that already knows language. Orpheus starts from Meta's Llama, and CosyVoice 2 from Alibaba's Qwen. Some add a last step, like chatbots: a reward model scores the output, and the TTS is tuned toward higher scores. CosyVoice 3 does this.

    How can one model speak with many voices? Many models describe a voice as a short list of numbers, called a speaker embedding. A fingerprint for a voice. Some ship with a fixed set of voices. Kokoro has 54. Others can clone a new voice. Zero-shot cloning copies a voice from a few seconds of audio, with no extra training. Professional cloning fine-tunes the model on more audio. ElevenLabs, for example, asks for at least thirty minutes, ideally two hours or more, and asks you to verify it's your own voice. A consent check.

    After training, how do you know it works? People listen and score it, or vote between two clips, like the arenas in episode three. Speech-to-text transcribes the output, and word error rate checks it said the right words. A speaker recognition model checks that a cloned voice sounds like the real one. F5-TTS, for example, was tested with Whisper for the English words, and a model based on WavLM for the voice.

    Data is also where the hard questions are. LibriVox recordings are public domain, at least in the US. Internet audio comes with licenses. The original Emilia set is for non-commercial use only. The F5-TTS team released its weights as non-commercial too, because of that training data. Some models add an inaudible watermark, so generated speech can be detected later. Chatterbox's code adds one to every clip by default.

    So before you choose a TTS, ask four questions: Where did the data come from? Did the speakers agree? Can I use it commercially? And what stops someone from cloning a voice without permission?

    Training methods change 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.