arrow_backBACK TO BUILDING VOICEBOTS — TELEPHONIC & BROWSER, THE REAL ENGINEERING
Lesson 05Building Voicebots — Telephonic & Browser, the Real Engineering5 min read

Text-to-Speech (TTS)

October 28, 2026

TL;DR

TTS turns the LLM's reply text into speech, and the number that matters is TIME-TO-FIRST-BYTE: how fast the first audio comes out, not how long the whole sentence is. Stream text from the LLM into the TTS sentence-by-sentence so the bot starts speaking while the LLM is still generating. Beyond latency: voice quality and naturalness (prosody, correct pronunciation of Indian names/places), SSML controls (pauses, emphasis, reading '₹2,000' correctly), and barge-in-friendliness (you MUST be able to stop TTS instantly when the user interrupts, Lesson 8). And cost: TTS is usually the BIGGEST line item — ElevenLabs sounds superb but costs a lot (illustratively ~10x+ Sarvam per minute of speech), while Sarvam and others give good Indian voices far cheaper. Choose per use case; it's the single biggest cost lever (Lesson 11).

STT gave your bot ears; TTS (Text-to-Speech) gives it a voice. It turns the LLM’s reply text back into audio the user hears. It’s the stage users judge the bot on most directly — a robotic or mispronouncing voice undermines everything — and, as you’ll see, it’s usually where most of your money goes. Two things dominate this lesson: making TTS fast (which is about streaming and time-to-first-byte), and choosing a provider that balances quality against cost for Indian voices.

Time-to-First-Byte Is Your Latency

The instinct is to think of TTS speed as “how long to generate the audio for this sentence.” For a voicebot, that’s the wrong number. What the user experiences as latency is time-to-first-byte (TTFB) — how long until the first audio starts playing. Once speech is flowing, the user is happy; the total length of the reply doesn’t add to the perceived delay (they’re listening to it).

Text-to-speech: time-to-first-audio is everything, stream the voice out as it's generated, don't wait for the whole sentence. The LLM streams text ('Yes, you are...') into a streaming TTS that produces the first audio byte in about 150 ms, and the speaker plays it so the user hears the bot almost at once. What matters for voice TTS: time-to-first-byte (TTFB), how fast the FIRST audio comes out, this is your latency not total length, stream text from the LLM into the TTS sentence-by-sentence so speech starts while the LLM is still going; voice quality and naturalness, prosody, emotion, correct pronunciation of Indian names and places; SSML controls, pauses, emphasis, numbers and dates ('₹2,000' to 'do hazaar rupaye'); barge-in friendly, you must be able to STOP TTS instantly when the user interrupts (Lesson 8); cost, TTS is often the BIGGEST line item (Lesson 11), ElevenLabs sounds superb but costs a lot, Sarvam and others give good Indian voices far cheaper

So the key technique is streaming TTS fed from a streaming LLM: as the LLM produces its reply token by token, you send completed chunks (a sentence, or even a clause) to the TTS immediately, and play the audio as it comes back. The bot starts speaking the first sentence while the LLM is still generating the rest. This is the TTS half of the “stream everything” principle (Lesson 1): combined with streaming STT (Lesson 4) and a fast LLM (Lesson 6), it’s how you get a sub-second turn (Lesson 8). A TTS that only returns audio after the whole reply is written adds its entire generation time to your latency — avoid it, or use it only for short replies.

Quality, Pronunciation, and Controls

Beyond speed, the things that make a voicebot’s voice good:

  • Naturalness and prosody. Does it sound like a person — with natural rhythm, intonation, and (where appropriate) warmth — or like a robot reading? This is where premium TTS (ElevenLabs) shines, and where cheap older TTS sounds obviously synthetic.
  • Correct pronunciation, especially of Indian names, places, and domain terms (scheme names, towns, people). A voice that mangles “Pradhan Mantri Awas Yojana” or a caller’s town sounds careless and erodes trust. Test your actual vocabulary.
  • SSML and controls. SSML (Speech Synthesis Markup Language) lets you control pauses, emphasis, and how things are read. Crucially, it handles numbers, dates and currency correctly: “₹2,000” should be spoken “do hazaar rupaye,” not “rupee two comma zero zero zero.” Getting numbers and dates right is a surprisingly common failure and matters a lot for schemes, amounts and appointments.
  • Multilingual voices. For India you need natural voices in the user’s language (Lesson 10) — a Hindi reply should sound like a Hindi speaker, not English TTS reading Hindi words.

Barge-in: You Must Be Able to Stop It

One requirement is easy to forget until it bites: your TTS must be interruptible. When the user barges in (Lesson 8) — starts talking while the bot is speaking — you have to stop the audio instantly and flush whatever’s queued. A TTS integration that can’t be cut off mid-sentence makes barge-in impossible, and a bot you can’t interrupt feels broken. So when you integrate TTS, make sure you control playback at a fine grain (you can stop and discard buffered audio immediately), not just “fire and forget a whole clip.” This is another reason a framework like Pipecat (Lesson 7), which handles flush-on-interrupt for you, is valuable.

The Big One: TTS Is Usually Your Biggest Cost

Here’s the fact that reshapes how you think about TTS: it’s typically the single largest line item in your per-minute cost (Lesson 11), and provider choice swings it enormously.

TTS providers quality vs cost (illustrative): the voice your users hear and usually your biggest bill. ElevenLabs: best-in-class naturalness and emotion, premium quality premium price. Sarvam TTS: natural Indian-language voices, strong Indic much cheaper. Google / Azure neural: many languages solid quality, cheap per char reliable. Open / self-hosted (e.g. Coqui): run your own full control, cheapest at scale more effort. Illustrative: ElevenLabs can cost about 10x+ per minute vs Sarvam for similar-length speech, TTS is the cost lever (Lesson 11)

The trade-off:

  • ElevenLabs sets the bar for naturalness and emotion — it sounds genuinely human. It’s also premium-priced; illustratively it can cost ~10×+ per minute of speech versus cheaper options. For a high-touch, low-volume use case where voice quality is the product, it can be worth it.
  • Sarvam TTS gives natural Indian-language voices much cheaper — a strong default for Indian multilingual voicebots where you need good Indic voices at scale.
  • Google/Azure neural TTS offers many languages at low per-character cost, reliably.
  • Open/self-hosted (e.g. Coqui-style models) is cheapest at scale but you operate it.

Because TTS cost scales with how much your bot talks, two levers follow directly (both in Lesson 11): pick a cheaper TTS (Sarvam/Google over ElevenLabs is often the single biggest saving), and cache TTS audio (many replies repeat — “please hold,” common answers — so synthesize once and reuse). The honest guidance: use the voice quality your use case actually needs. A citizen helpline at huge volume should probably use a cost-effective Indic TTS; a premium concierge bot might justify ElevenLabs. Don’t pay for premium voice you don’t need, and don’t ship a robotic voice for something user-facing and important — match it to the job.

Pitfalls to Avoid

  1. Optimising total generation time, not TTFB. The user feels time-to-first-byte. Stream TTS from the LLM sentence-by-sentence so speech starts fast.
  2. Non-streaming TTS for long replies. Waiting for the whole reply to synthesize adds its full time to latency. Stream, or keep replies short (Lesson 6).
  3. Mangling numbers, dates and names. “₹2,000” read as digits, or a mispronounced scheme/town name, sounds careless. Use SSML and test your real vocabulary.
  4. TTS you can’t interrupt. Breaks barge-in (Lesson 8). Ensure you can stop and flush audio instantly.
  5. Defaulting to the most expensive voice. TTS is usually your biggest cost; ElevenLabs can be ~10×+ Sarvam. Match voice quality to the use case and cache repeated audio (Lesson 11).
  6. Using English TTS for Indian-language replies. It sounds wrong. Use natural voices in the user’s actual language.

Quick Recap

  • The latency that matters is time-to-first-byte — stream text from the LLM into TTS sentence-by-sentence so the bot speaks while the LLM is still generating.
  • Quality means naturalness, correct pronunciation of Indian names/numbers/dates (SSML), and multilingual voices; and TTS must be interruptible for barge-in (Lesson 8).
  • TTS is usually your biggest cost: ElevenLabs sounds superb but is premium (illustratively ~10×+ Sarvam/min); Sarvam and others give good Indian voices far cheaper.
  • Levers: pick a cost-effective Indic TTS and cache repeated audio (Lesson 11). Match voice quality to the use case.

Next lesson: the brain between the ears and the voice — the LLM — and why prompting it for a spoken conversation is a different craft from prompting it for chat.