How to Build a Sub-500ms Audio Pipeline for Voice Agents
A parent dials a pediatric clinic at seven in the evening, holding a feverish toddler in one arm and the phone in the other. If the automated receptionist on the other end pauses for even 800 milliseconds after the parent explains the symptoms, the human rhythm fractures. The caller speaks again, assuming the call dropped, right as the synthetic voice starts answering. Both talk over each other in an agonizing, disjointed collision. In clinical operations and front-desk management, that tiny silence is not merely a technical inconvenience. It breeds frustration, erodes trust, and sends overwhelmed callers directly to emergency departments.
Decades of psycholinguistic research show that human turn-taking in natural conversation operates on a razor-thin window between 200 and 500 milliseconds. Cross that threshold, and our brains register delay as hesitation, confusion, or rudeness. For healthcare systems drowning in inbound phone traffic, building a sub-500ms audio pipeline is the difference between an operational lifesaver and an abandoned call.
The Anatomy of the Latency Budget
Hitting real-time speeds across standard telephone networks requires treating time as a non-renewable currency. When engineering a low latency conversational AI system for hospital scheduling and front-desk dispatch, every component must live within an unforgiving voice agent latency budget.
| Pipeline Component | Allocated Latency Window | Primary Technical Bottleneck |
|---|---|---|
| Voice Activity Detection (VAD) | 30 to 60 ms | Accurate silence endpointing without truncating natural pauses |
| Streaming Speech-to-Text (STT) | 100 to 150 ms | Time-to-first-chunk transcript delivery over compressed telephone audio |
| LLM Time to First Token (TTFT) | 50 to 100 ms | Prompt processing overhead and transformer decoding speed |
| Streaming Text-to-Speech (TTS) | 80 to 120 ms | Acoustic model synthesis and neural vocoder generation |
| Network Transport and Telephony RTT | 30 to 50 ms | Jitter buffers, SIP trunk bridging, and transit hops |
| Total End-to-End Budget | 290 to 480 ms | Zero margin for serial task blocking |
If an architecture handles each stage serially, waiting for the patient to finish speaking, transcribing the entire sentence, prompting the model, and synthesizing full audio files, turnaround times routinely spike past two seconds. Sub-500ms execution demands radical concurrency.
Ditching Legacy Protocols: The WebRTC Imperative
Traditional web architectures rely on standard REST APIs or standard WebSockets. While basic WebSockets handle two-way data well, they run over TCP, which suffers from head-of-line blocking whenever packet loss occurs. In high-volume telephony environments, lost packets trigger retransmission delays that instantly blow past latency budgets.
Production systems increasingly adopt WebRTC voice AI architecture. By routing raw audio streams through User Datagram Protocol (UDP), WebRTC prioritizes freshness over lossless delivery. Built-in jitter buffers, packet-loss concealment, and adaptive echo suppression keep the voice stream moving even across congested mobile networks. Voice orchestration engines deployed close to the user on edge networks (such as Fly.io or regional cloud zones) interface directly with telecom SIP trunks, shaving precious milliseconds off round-trip times before processing begins.
Micro-Chunking the Streaming STT TTS Pipeline
The true breakthrough in modern voice architecture lies in token-level pipelining. Instead of waiting for full linguistic clauses, developers must link streaming inputs directly to downstream outputs.
Next-generation automatic speech recognition engines, such as Deepgram, emit transcript chunks within 100 to 180 milliseconds without degrading word error rates below medical safety levels. As soon as these transcript fragments hit the orchestration layer, they feed into the language model. By utilizing Language Processing Units (LPUs) from providers like Groq, or inference runtimes like vLLM and TensorRT-LLM on compact eight-billion-parameter open models, Time to First Token voice pipeline metrics drop to between 30 and 45 milliseconds.
The streaming STT TTS pipeline does not pause for a finished thought. Once the model outputs its first three to five tokens, those words immediately enter neural speech engines like Cartesia or ElevenLabs Turbo. These modern acoustic engines produce their first synthetic audio slice in roughly 90 milliseconds. The patient hears the start of the response while the language model is still calculating the tail end of the sentence.
True conversational parity does not require instantaneous reasoning across the entire answer. It requires immediate, intelligible speech on the first syllable while the rest of the thought computes in flight.
Handling Voice Activity Detection and Barge-In
Speed is worthless if the agent cannot listen while talking. Patients navigating appointment reschedules, insurance verifications, or urgent prescription refills frequently interrupt. They correct misheard dates, change their minds, or clarify provider preferences.
Handling this fluidly requires advanced voice activity detection barge-in mechanics. High-accuracy neural VADs, such as Silero VAD, run directly at the edge to detect human speech energy within 30 milliseconds. When a caller speaks over the agent, two synchronized events must happen instantly:
- Acoustic Echo Cancellation (AEC): The system isolates caller audio from the synthetic voice blasting through the earpiece, preventing the agent from triggering false interruptions on its own voice.
- Immediate State Invalidation: The audio gateway cuts the outbound audio stream immediately, flushes the remaining synthesis buffer, and signals the language model to cancel pending token generation.
Without zero-latency cancellation, the agent keeps speaking for another half-second while trying to comprehend the new input, completely alienating the caller.
The Road Ahead: Native Speech to Speech
Developer platforms like Vapi, Retell AI, and Bland AI have demonstrated what is possible by orchestrating discrete models over WebRTC. Open frameworks like LiveKit Agents can chain separate speech recognition, inference, and synthesis engines down to 400 milliseconds under clean conditions.
Yet the architectural frontier points toward real-time speech to speech foundations. Native multimodal architectures, like the OpenAI Realtime framework, eliminate the middle step entirely. Speech enters the neural network as acoustic tokens, and speech emerges as acoustic tokens. Bypassing text conversion preserves vocal inflection, eliminates transcribing errors, and cuts internal processing hops.
For administrative healthcare teams facing historic staffing shortages, building conversational voice infrastructure that responds under 500 milliseconds is not about novel parlor tricks. It is about restoring dignified, responsive access to care the instant the phone rings.