Skip to content
GenAI Learn/Multimodal Systems
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

Real-Time Speech and Latency Budgets

4 min readChapter 2 of 4

You'll learn to

  • -Compare a cascaded speech pipeline with a single speech-to-speech model
  • -Build a latency budget from the end of the user's speech to the first sound back
  • -Explain the trade-off in deciding when the user has stopped talking
  • -Describe barge-in and why interrupting needs to cancel work already in flight

Tip: the highlighter is on - just select any text below to mark it. Use the highlighter button up top to change color or turn it off. Highlights are saved on this device only. Log in to save them to your account instead.

A voice assistant lives or dies on one number: how long the silence lasts after you stop talking. A chat window can take three seconds and feel fine. On the phone, a pause of a second or two feels like the line has dropped. So real-time speech is mostly a latency problem, and the way to win it is to write the budget down before you build.

An Analogy: A Phone Call With a Translator

Picture a phone call where a translator listens, writes down what you said, hands the note to an expert, and then reads the expert's reply aloud. Each hand-off adds a delay, and the translator also has to decide when you have finished, because jumping in too early is rude and waiting too long is slow. A cascaded speech system is that chain. A speech-to-speech model is closer to a bilingual expert who simply answers.

Two Architectures

  • -Cascaded: voice activity detection and endpointing, then speech recognition, then the language model, then text-to-speech. Each part can be chosen and tested on its own, and you can see the text in the middle. Latency adds up across stages.
  • -Speech to speech: one model takes audio in and produces audio out. It can have lower latency and keep tone and emotion, but you have less control and less visibility in between.
  • -Either way, stream everything: partial transcripts into the model, tokens into speech synthesis sentence by sentence, audio to the speaker as it is produced.

The code builds budgets for three designs from the end of the user's speech to the first audio the user hears. All the millisecond figures are made-up assumptions for teaching, not measurements of any product, and the 800 ms target is a stand-in for whatever your users will accept.

Press Run: three latency budgets, and what a shorter endpoint wait does

The plain cascaded design totals 1,150 ms and misses the target, and the largest piece is not a model at all: it is the 400 ms spent waiting to be sure the user has stopped. Tuning that wait to 250 ms and using streaming recognition brings it to 900 ms, and now the language model's first token is the biggest piece. The speech-to-speech design reaches 650 ms by removing two stages. The table at the end shows the price of impatience: every millisecond cut from the endpoint wait comes straight off the total, but a short wait will cut off people who pause mid-sentence.

Turn-Taking and Interruptions

  • -Endpointing is a trade-off between speed and cutting people off. Test it with slow talkers, accents and noisy rooms.
  • -Barge-in means the user talks over the assistant. The system must stop playing, cancel the model and speech synthesis already running, and remember what the user actually heard so the conversation stays coherent.
  • -Echo is a hazard: the assistant's own voice coming out of the speaker must not be mistaken for the user.
  • -Check whether the speech recognition model you choose supports streaming. Whisper, for example, was trained on 680,000 hours of multilingual and multitask audio, but how it is run for live use is an engineering choice.

Test with real people, not only with a stopwatch. Acceptable delay depends on the task, and recording voices brings consent and privacy obligations. Do not clone or store someone's voice without permission.

Interview Signal is part of Pro

See a real weak answer next to a real strong one for this exact topic.

Quiz is part of Pro

Test what you just read with a short quiz, and bank the XP.

Discussion0

Join the Discussion

Sign in to leave comments, reply to others, or like insights.

Sign In to ScaleDojo

No comments yet. Be the first to start the thread!