Glossary · Models & serving

How does streaming TTS work?

Streaming TTS

Streaming text-to-speech sends audio back in small pieces while it's still being made, so playback can start before the whole sentence is ready. Live voice agents depend on it.

Also called streaming text to speech, real-time TTS, chunked TTS, WebSocket TTS or incremental speech synthesis.

On a call

The model writes "नमस्ते, मैं City Clinic से बोल रही हूँ, आपकी appointment कल है." With streaming, the caller hears "नमस्ते" while the rest is still being made. Without it, they sit through silence until the whole line is done.

AI agents from ₹1 a minute.¹

Open the sandbox

No sign-up to look around.

Explained

Here is how it works, in plain words.

Without streaming, text-to-speech works like a print shop. You hand over the text, wait for the whole file, then play it. That’s fine for a voicemail and painful on a live call, where every second of silence before the agent speaks feels like a dropped line.

Streaming changes the order. The service starts sending audio as soon as it has some, and keeps sending while it works on the rest. Your player starts on the first piece. If synthesis runs faster than speech, the caller never hears a gap.

There are two common shapes. The simple one is an HTTP request whose response arrives in chunks: send one sentence, play the audio as it streams back. OpenAI’s Speech API works this way, using chunked transfer. The fuller one is a WebSocket held open for the whole call. You push text in as the language model writes it, and audio flows back on the same connection.

The socket wins on a call for a few reasons. You pay the connection setup once instead of per sentence. The service can start on the next sentence while the current one plays, so there’s no pause between them. And when the caller barges in, one message stops everything, instead of chasing several open requests.

Streaming has its own failure modes. If your server falls behind real time, the caller hears the voice break up mid-sentence. If playback starts on a tiny first chunk, they hear a clipped syllable. Keep a small buffer before each sentence starts, send the phone line a little ahead of real time, and pick an audio format your link can carry for every call at once.

Also cut text at sentence ends. A voice reads a full sentence with better rhythm than half of one.

In Frequency

This is what Frequency does about it.

Our streaming endpoint keeps one WebSocket open for the whole call. You send text as your model writes it, we find the sentence ends, and the next sentence is made while the current one plays. When the caller interrupts, one message stops the audio that was playing.

By Frequency · Published

  1. AI agents from ₹1 a minute: on our volume plan, ₹1,00,000 a month. Pay as you go is ₹5 a minute. Prices exclude GST.