AI-ENGINEERING
    intermediate

    Voice AI: ASR, TTS & Realtime

    AI Engineer path · lesson 64 of 124
    The idea
    A cascaded voice agent is a relay race: listener → translator → thinker → speaker, each handing a baton. The audience only notices the total time, so every runner must start moving before the previous one fully finishes — streaming is the whole sport. A speech-native model is one runner who does all four legs.
    How to use
    Toggle each stage between naive and optimized and watch the total latency cross (or miss) the 1-second conversational bar.
    Four stages, each adding delay. Click a stage to optimize it (streaming, smaller model, colocated inference):
    3.9s to first spoken reply
    ▲ conversational bar (~1.2s)

    Key insight

    No single stage kills a voice agent — the sum does. The cascade only hits conversational speed when every stage streams into the next: ASR emits partial transcripts, the LLM streams its first sentence, and TTS starts speaking while the rest is still generating.

    A spoken turn, end to end

    Sequence

    Order a cascaded voice pipeline.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Order the stages of a cascaded voice agent:

    The short version

    A cascaded voice agent is a relay race: listener → translator → thinker → speaker, each handing a baton. The audience only notices the total time, so every runner must start moving before the previous one fully finishes — streaming is the whole sport. A speech-native model is one runner who does all four legs.

    In more depth

    Voice AI: ASR, TTS & Realtime

    Voice adds a constraint text never had: a human waiting in silence. Two architectures compete:

    Cascaded pipeline

    VAD → ASR → LLM → TTS. Each stage streams into the next: partial transcripts prefill the LLM, the first generated sentence starts TTS while the rest is still writing. The text hop between stages is a feature — it's where logging, guardrails, and tool-calling live — but it flattens speech to text, discarding tone, hesitation, and overlap.

    Native speech-to-speech

    Realtime models consume and produce audio tokens directly: lowest latency, natural prosody, real interruptions, paralinguistics preserved — but no text checkpoint, harder moderation, and less component control.

    The numbers that matter

    Human turn-gaps average ~250 ms; past ~1 s silence reads as broken.
    The metric is time-to-first-audio, not time-to-complete-answer — ship the first syllable fast and users grant you the rest.
    Turn-taking is the product: endpointing (deciding the user finished — semantic endpointing uses the LLM to judge completeness) and barge-in (kill TTS <100 ms when the caller speaks).
    Voice is billed in audio-minutes and tokens; a 5-minute call can cost 10-50× a chat session — route, cap, summarize.
    Eval ASR word-error-rate on your callers (noise, accents, code-switching), not clean benchmarks, and run moderation on the transcript stream.

    Interview Questions

    OpenAI
    Google
    Amazon
    OpenAI
    Anthropic
    Google
    Amazon
    ElevenLabs
    Google
    OpenAI
    ElevenLabs
    Amazon
    ElevenLabs
    Amazon
    Google

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required