All posts

Streaming TTS

/AI/4 min read

A batch TTS engine synthesises a whole sentence before you hear any of it: 7.2 s of speech at 10× real time is a 0.72 s wait. A streaming engine starts speaking after a few words — but it has to commit to intonation before it knows how the sentence ends.

Text-to-speech used to work like printing a document: give it the whole text, wait, get the whole audio file back. That is fine for audiobooks. For a voice agent, every millisecond before the first sound is silence the user hears.

Streaming TTS starts producing audio before it has finished — and, in its fuller form, before it has even received all the text.

Two kinds of streaming

Streaming output. The engine still receives a complete sentence, but returns audio in small pieces as it synthesises them, rather than one file at the end. The first piece can play while the rest is generated.

Streaming input and output. The engine accepts text incrementally — words or tokens as the language model produces them — and produces audio incrementally too. It can begin speaking the start of a sentence whose end has not been written yet.

The second is what voice agents need to get time-to-first-audio down, because it removes the wait for the language model to finish a sentence.

What batch synthesis costs

An 18-word sentence spoken at 150 words a minute is 7.2 seconds of audio. A fast TTS engine synthesising at 10× real time — a real-time factor of 0.1 — takes 0.72 seconds to produce it.

first audio after the text arrives
batch: synthesise all, then play0.72 s
streaming outputthe time to synthesise the first piece — tens to a couple of hundred ms

And with streaming input, the engine does not wait for the 18-word sentence at all; it can start after the first few words, saving the 0.3–0.4 s the language model would have spent finishing it.

The core difficulty: commitment

Speaking well needs to know what comes next. Intonation is shaped over a whole phrase: a question rises at the end, a list has a characteristic rhythm, emphasis depends on contrast with words that may not have arrived yet.

A streaming engine has to start speaking before it has that information. Whatever it has already played, it has committed to. If the sentence turns out to be a question, the opening words were already spoken with a statement's contour.

Engines handle this with a small lookahead: they wait for a few words beyond the current one before synthesising it, so they can see the immediate context. More lookahead gives better prosody and more delay; less gives faster first audio and flatter or occasionally wrong intonation. It is the same trade as sentence chunking, moved inside the model.

SPEAK WITH A FEW WORDS OF LOOKAHEAD text in lookahead audio out batch wait for 18 words + 0.72 s more lookahead: better intonation, later start audio must keep arriving faster than it plays — real-time factor below 1, with margin a stalled stream is a gap mid-sentence, which sounds worse than a slower start
Streaming moves the wait from "the whole sentence" to "a few words ahead".

Keeping the stream fed

Once playback starts, audio must keep arriving faster than it is played. That requires two things:

A real-time factor comfortably below 1. A model producing audio at 0.5× real time — two seconds of audio per second of compute — keeps up even with some variation. One at 0.95× will stall the moment the server is busy.

Text arriving faster than it is spoken. The language model must stay ahead of the voice. At 50 tokens a second against speech that consumes about 3 tokens a second, it normally does — unless the model pauses for a tool call mid-reply, which is a reason to finish a spoken sentence before calling tools.

A stall mid-sentence is worse than a slower start. Listeners tolerate a pause before an answer; a gap in the middle of a word sounds broken. Players usually keep a small buffer — a hundred milliseconds or so — to absorb jitter, which adds slightly to first-audio time in exchange for smooth playback.

Interruption and alignment

Streaming TTS also has to support stopping. When the user barges in, the engine must abandon the rest of the utterance immediately, and the agent needs to know exactly how much was spoken. Engines that return word-level timestamps alongside the audio make this straightforward: the agent can cut its record of the reply to the last word actually played.

The same timestamps support lip-sync for avatars and highlighting of words on screen as they are spoken.

Choosing an engine for a voice agent

The properties that matter, roughly in order:

  1. Time to first audio for a short first chunk, measured at the client.
  2. Streaming text input over a persistent connection, so per-request overhead is paid once.
  3. Real-time factor with headroom at your expected concurrency.
  4. Prosody with little lookahead — listen to questions and lists.
  5. Word timestamps for interruption handling.
  6. Pronunciation control for names, numbers and domain terms.

What to take away

Batch TTS makes the user wait for an entire sentence to be synthesised — 0.72 s for 7.2 s of speech even at 10× real time. Streaming TTS starts playing after the first piece, and with streaming input it can begin before the language model has finished the sentence.

The cost is commitment: the engine speaks before it knows the end of the phrase, and uses a few words of lookahead to guess intonation. Keep the real-time factor well below 1, keep the text ahead of the voice, and use word timestamps so interruptions cut the record where the speech actually stopped.