# How AI Voice Agents Work: Every Step From Ring to Reply, With Milliseconds and Rupees

By Shreyas Raj, founder of RapidXAI. Updated 2026-11-29.

**Short answer:** An AI voice agent works as a loop. Phone audio streams into a server, a voice activity detector spots when the caller is talking, a speech-to-text model transcribes it, a language model decides what to say and calls tools like a calendar, and a text-to-speech model speaks the answer back down the line. Newer speech-to-speech models collapse the middle three steps into one model. The whole turn should finish in under about a second, because humans normally reply within a few hundred milliseconds.

## The 8-step loop behind every turn

Every turn of every AI phone call runs this loop. Learn it once and every vendor pitch gets easier to decode.

1. **Phone network.** The call arrives over a telephony provider as a stream of audio packets.
2. **Media server.** A server (often LiveKit or similar) receives that stream and hands it to your agent code.
3. **Voice activity detection (VAD).** A tiny model flags "someone is speaking" vs silence.
4. **Turn detection.** Logic decides the caller has actually finished, not just paused for breath.
5. **Speech-to-text (STT).** Audio becomes words, streamed as the caller speaks.
6. **Language model (LLM) + tools.** The brain reads the transcript, checks the calendar or CRM, and writes a reply.
7. **Text-to-speech (TTS).** The reply becomes audio, starting before the full sentence is even written.
8. **Back to the phone.** Audio streams down to the caller. If they interrupt, playback stops instantly (barge-in).

Steps 5 to 7 are the "cascade". Speech-to-speech models fuse them. More on that below.

## Step 1 and 2: the phone line is worse than you think

Your agent never hears studio audio. It hears the phone network.

Twilio's docs, for example, state that streamed call audio is mu-law encoded at 8,000 samples per second [1]. That format traces back to ITU-T G.711, the 1988 standard for pulse code modulation of voice [2].

Compare that with what modern AI models want. Google's Live API takes 16 kHz audio in and sends 24 kHz audio out [5]. So every call starts with a downgrade, then an upsample (sorry, audiophiles).

Google even warns that for noisy 8 kHz telephony audio you should send 16 kHz or denoise upstream before its Chirp 3 recognizer [16]. Phone audio quality is the first place accuracy leaks.

> **Practical tip:** Host your agent close to your phone provider. Shreyas Raj picks a Mumbai server region for Indian calls in his outbound build for exactly this reason: every extra network hop is added silence.

## Step 3 and 4: knowing when the caller is done

This is the hardest problem nobody puts on the brochure.

**VAD** is the easy half. Silero VAD, a popular open model, claims it processes a 30 ms audio chunk in under 1 ms on a single CPU thread, works at 8 kHz and 16 kHz, and weighs about two megabytes [3].

**Turn detection** is the hard half. "My number is 98220..." followed by a pause is not the end of a turn. A naive agent jumps in and talks over the caller.

Most systems wait for a stretch of silence. Google's Live API defaults to roughly 800 ms of silence and recommends 500 to 800 ms [5]. That wait alone can be most of your delay.

Smarter stacks add a model that judges meaning. LiveKit's default turn detector predicts the end of a turn from what was said and how it sounded, on top of VAD [4]. It also has an adaptive interruption mode that tries to tell a real interruption from a polite "haan, haan" [4].

Deeper dive: [turn-taking and interruptions](/guides/turn-taking-and-interruptions/).

## Step 5: speech-to-text, streamed

Good agents do not wait for the caller to finish before transcribing. Streaming STT sends partial words every fraction of a second, so the transcript is nearly ready when the turn ends.

Speed targets are getting aggressive. Sarvam says a coming fast mode of its Saaras V3 model targets under 150 ms to first token [8].

Accuracy, accents and code-switching get their own page: [speech-to-text explained](/guides/speech-to-text-explained/).

## Step 6: the brain, and the tools it holds

The LLM gets the transcript, your system prompt, and the conversation so far. It either replies or calls a tool.

Tools are what make an agent useful. "Check slots for Saturday" becomes a function call to your calendar. The result comes back as data, and the model phrases it as speech.

Two rules we follow on every build:

- **Say something before a slow tool.** "One sec, checking Saturday" covers a 1 to 2 second lookup. Silence does not.
- **Keep the prompt lean.** Every turn re-sends your instructions. In his Gemini Live outbound build, Shreyas shows the per-minute cost climbing from about ₹1.74 toward ₹2.5 or more as the prompt and context grow.

Writing a prompt that survives real callers is its own craft: [how to write a voice agent prompt](/guides/how-to-write-a-voice-agent-prompt/).

## Step 7 and 8: speaking, and shutting up on cue

TTS streams too. The LLM writes the first clause, TTS starts speaking it, and the rest follows.

The metric that matters is time to first audio. Artificial Analysis defines it as the time from submitting text until a listener would first hear speech, including any leading silence [6]. A first chunk at 100 ms plus 250 ms of silence counts as 350 ms [6].

Fast commercial models are now in that range. ElevenLabs lists a median of about 100 ms for its Flash v2.5 model, excluding network and app time [7].

Then barge-in. The moment the caller speaks over the agent, playback must stop and the agent must listen. Get this wrong and callers feel steamrolled (and hang up).

## Where the milliseconds go in one turn

Here is a target budget for one cascaded turn on an Indian phone call. The sourced rows come from vendor docs; the rest are the targets we design to.

| Stage | Target | Notes |
|---|---|---|
| VAD on each chunk | Under 1 ms | Silero's own claim [3] |
| Silence wait before replying | 500 to 800 ms | Google's recommended range [5]. The biggest single chunk |
| Final STT words after turn ends | 100 to 200 ms | Streaming hides most of it; Sarvam targets under 150 ms to first token [8] |
| LLM first words | 200 to 500 ms | Our design target. Depends on model, host and prompt size |
| TTS first audio | About 100 ms+ | ElevenLabs Flash median, before network [7] |
| Network both ways | 50 to 150 ms | Our design target. Mumbai hosting for Indian numbers |
| Total turn | About 0.9 to 1.8 s | Semantic turn detection can cut the silence wait |

Now compare with people. A 2009 PNAS study across 10 languages found the most common gap between turns sits near zero, and even the slowest language averaged about half a second [10]. Our budget is slower than a human, which is why every 100 ms you shave is felt.

In his ₹2 per minute build, Shreyas measures about 800 ms of latency with a cascaded stack of Vobiz, LiveKit, Deepgram, a Groq-hosted LLM and Sarvam voices:

Video: [I Built an AI Voice Agent for ₹2/Min (No Vapi Needed)](https://www.youtube.com/watch?v=XIL_XqQAu0s)

## The newer path: speech-to-speech

OpenAI described the problem with cascades bluntly. Its old three-model voice pipeline lost tone, multiple speakers and background sound, because everything was squeezed into text [9].

Speech-to-speech models take audio in and produce audio out, inside one model. Google's Live API, for instance, holds one WebSocket session that streams audio both ways, detects speech by default, and handles tool calls [5].

|  | Cascade (STT + LLM + TTS) | Speech-to-speech |
|---|---|---|
| Moving parts | Three vendors, three bills | One model, one bill |
| Tone and emotion | Lost at the text step | Kept end to end |
| Control | Pick the best STT for Hindi, best voice for brand | Stuck with the model's ears and voices |
| Debugging | Transcript at every step | Harder to see what it "heard" |
| Session limits | Your own | Gemini audio sessions capped at 15 minutes without session management [5] |

**Our take:** use speech-to-speech for speed and natural feel on high-volume, simple calls. Use a cascade when you need a specific Indian-language recognizer, a branded voice, or strict audit trails. The full trade-off lives in [speech-to-speech models](/guides/speech-to-speech-models/).

Here is the speech-to-speech version of the same idea, Gemini Live doing hearing, thinking and speaking in one model, with LiveKit and Vobiz around it:

Video: [Cold Calling AI Army: Full Outbound System for ₹2/min (Gemini Live + LiveKit + Vobiz)](https://www.youtube.com/watch?v=niNpiBiqXDE)

## What 1,000 three-minute calls cost, stage by stage

Assume each call is 3 minutes and the agent speaks about 1,000 characters (roughly 170 words) per call. List prices as of November 2026, at about ₹94 to the dollar [15].

| Stage | Cascade per call | Speech-to-speech per call |
|---|---|---|
| Phone line | ₹0.42/min x 3 = ₹1.26 [14] | ₹1.26 [14] |
| Hearing | Sarvam STT ₹0.49/min x 3 = ₹1.47 [13] | Gemini 3.8 Live audio in, $0.005/min x 3 = about ₹1.41 [11] |
| Thinking | LLM tokens, our estimate about ₹0.30 | Prompt text tokens on top, varies with prompt size [11] |
| Speaking | Bulbul V4 Flash ₹2 per 1,000 chars = ₹2.00 [13] | Audio out $0.018/min x about 1.2 min = about ₹2.03 [11] |
| Per call | About ₹5.00 | About ₹4.70 plus prompt tokens |
| Per 1,000 calls | About ₹5,000 | About ₹4,700+ |

Swap Sarvam STT for Deepgram Nova-3 multilingual at $0.0058 per minute and hearing costs about ₹1.64 per call instead [12]. The totals barely move. (Hint: the phone line and the voice are most of your bill.)

For hosting, setup and monthly maths, see [AI voice agent cost in India](/guides/ai-voice-agent-cost-india/).

## Where real pipelines break

- **Turn detection too eager.** Agent interrupts callers reading out phone numbers. Fix: longer silence wait while collecting digits, or a semantic turn detector.
- **Turn detection too lazy.** Awkward 2-second pauses. Fix: shorter silence window plus a quick filler phrase.
- **Echo.** The agent hears its own voice on speakerphone and interrupts itself. Fix: echo cancellation and a minimum interruption duration.
- **Slow tool calls in silence.** Fix: speak first, fetch second.
- **Server in the wrong country.** Fix: host near the phone provider.
- **Nobody tested on 8 kHz audio.** Fix: test through a real phone line, not a laptop mic.

A proper test plan is in [testing and evaluating voice agents](/guides/testing-and-evaluating-voice-agents/).

## Questions people ask

### What are the main components of an AI voice agent?
Telephony, a media server, voice activity detection, turn detection, speech-to-text, a language model with tools, and text-to-speech. Speech-to-speech models merge speech-to-text, the language model and text-to-speech into one.

### Why does my voice agent take so long to reply?
Usually the silence wait before it decides you have finished speaking, followed by the language model's first words and any tool calls. Google recommends a silence window of 500 to 800 ms, so that alone can be most of the delay.

### What audio quality does a phone call give an AI agent?
Usually 8 kHz mu-law audio, the old G.711 telephone standard. Most AI speech models are designed for 16 kHz or higher, so phone calls start with lower-quality audio than a laptop microphone.

### Is speech-to-speech better than a cascaded pipeline?
It is faster and keeps tone, but you lose the ability to choose the best recognizer and voice separately, and it is harder to debug. For Indian-language accuracy or a specific brand voice, a cascade is often the safer choice.

### What is barge-in?
Barge-in means the caller can interrupt the agent mid-sentence. The agent must stop speaking instantly and listen. Without it, callers feel talked over.

## Sources

1. [Media Streams: WebSocket messages](https://www.twilio.com/docs/voice/media-streams/websocket-messages), Twilio Docs
2. [G.711: Pulse code modulation (PCM) of voice frequencies](https://www.itu.int/rec/T-REC-G.711), ITU-T
3. [Silero VAD](https://github.com/snakers4/silero-vad), GitHub (snakers4)
4. [Turn detection and interruptions](https://docs.livekit.io/agents/build/turns/), LiveKit Docs
5. [Live API capabilities guide](https://aistudio.google.com/docs/live-guide), Google AI for Developers
6. [Text to Speech benchmarking methodology](https://artificialanalysis.ai/methodology/text-to-speech), Artificial Analysis
7. [Models overview](https://elevenlabs.io/docs/overview/models), ElevenLabs Docs
8. [Introducing Saaras V3](https://sarvam.ai/blogs/asr), Sarvam AI
9. [Hello GPT-4o](https://openai.com/index/hello-gpt-4o/), OpenAI
10. [Universals and cultural variation in turn-taking in conversation (Stivers et al., PNAS)](https://pmc.ncbi.nlm.nih.gov/articles/PMC2705608), PNAS via PubMed Central
11. [Gemini Developer API pricing](https://aistudio.google.com/docs/pricing), Google AI for Developers
12. [Deepgram pricing](https://deepgram.com/pricing), Deepgram
13. [API pricing](https://www.sarvam.ai/api-pricing), Sarvam AI
14. [Vobiz pricing](https://www.vobiz.ai/pricing), Vobiz
15. [Rupee rises 27 paise to close at 93.92 against US dollar](https://hdfcsky.com/news/rupee-rises-27-paise-to-close-at-93-92-against-us-dollar), HDFC Sky
16. [Chirp 3 model](https://docs.cloud.google.com/speech-to-text/v2/docs/chirp_3-model), Google Cloud Speech-to-Text Docs
