Full-Duplex Real-Time Voice Interaction: A Practical Engineering Guide
This guide walks through the evolution of voice interaction from push-to-talk to full-duplex, then breaks down a deployable real-time voice system into six streaming layers. It covers the key engineering challenges: end-to-end latency budgeting, probabilistic endpointing and interruption handling, echo and self-noise control, coordination between streaming ASR and streaming TTS, transport and jitter management on weak networks, and evaluation, observability, and cost. A reference session skeleton and practical rollout advice help teams decide how to move existing voice features toward natural, user-controlled conversation.
1. From Walkie-Talkies to Telephones: Three Generations of Voice Interaction
The industry generally describes voice interaction in three stages. The first generation is “recording-style” interaction: the user finishes speaking, the system recognizes the whole utterance and responds to it as a whole, and the pace of the exchange is driven by a button or a fixed duration. The second generation is “half-duplex” interaction: the system introduces streaming recognition and streaming synthesis, transcribing while the user speaks and generating audio while it plays, but only one side may produce sound at any given moment, so the user has to wait until the system finishes before speaking. The third generation points to full-duplex: the system and the person can genuinely produce sound at the same time, the system can be interrupted mid-speech, can sense silence and attempts to take the floor, and merges “listening” and “speaking” into a single continuously running bidirectional link.
It is worth stressing that full-duplex is not simply a matter of “lowering latency.” It is a transfer of conversational control: from “the system assigns turns” to “turns emerge naturally from the conversation.” This raises a series of new problems: when to take the floor, when to yield, how to recover gracefully after an interruption, and how to distinguish background noise from self-noise. The rest of this article addresses these engineering problems.
2. A Layered Architecture for the Full-Duplex Link
A real-time voice system that can actually ship is usually split into six layers, coupled by streaming data rather than one-shot requests:
- Audio input layer: capture, resampling, channel handling, and buffer management.
- Signal processing layer: echo cancellation, noise suppression, automatic gain, and silence detection.
- Semantic front-end layer: streaming speech recognition that emits incremental text with confidence.
- Dialogue decision layer: endpointing, interruption detection, turn arbitration, policy, and tool calls.
- Generation and synthesis layer: streaming output from the language model and incremental audio from speech synthesis.
- Transport and governance layer: transport protocol, jitter buffer, monitoring and alerting, logging, and canary rollout.
The most common engineering mistake is building layers 3 and 5 as “whole input in, whole output out.” No matter how fast the model is, that makes interruption impossible. The prerequisite for full-duplex is that every layer must be streaming, and downstream consumers must be able to retract unconfirmed results using “cancel/replace” semantics.
3. Six Key Engineering Problems
3.1 Latency Budget: Set the Budget First, Then Choose the Technology
The experience of real-time voice is determined by end-to-end latency. Draw up a budget table first, then work backward to how much headroom each layer gets. A common allocation (numbers need to be calibrated against real measurements for your use case):
- Capture and buffering: 10–30 ms
- Echo cancellation and noise reduction: 10–40 ms
- Streaming recognition tail packet: 100–300 ms
- Decision and first-packet generation: 100–300 ms
- Synthesis first packet: 50–150 ms
- Network and jitter buffer: 50–200 ms
The conclusion is straightforward: if recognition must wait for the “end of the full sentence” before returning a result, the tail packet will consume the entire budget. Endpoint detection therefore has to make incremental judgments rather than relying on a one-size-fits-all fixed silence threshold.
3.2 Endpointing and Interruption: Turning “Finished Speaking” into a Probability Problem
Do not decide that a turn is over using a fixed silence duration. Instead, score multiple signals together: silence duration, prosodic decline, semantic completeness, and the user’s historical habits. Illustrative logic:
def should_yield(context):# Weighted multi-signal scoring, not a single silence thresholdscore = (0.4 * context.prosody_completeness # whether intonation closes+ 0.3 * context.semantic_completeness # whether meaning is complete+ 0.2 * context.silence_ratio # proportion of silence+ 0.1 * context.user_talk_speed_prior # personal habit prior)return score > context.dynamic_threshold # threshold adapts to the scenario
Interruption detection has to separate three kinds of input: real user speech, background human voices, and echo from the system’s own speaker. Only the first is allowed to interrupt, which depends directly on echo cancellation quality and “self-noise gating.”
3.3 Echo and Self-Noise: The Make-or-Break Line for Full-Duplex
Full-duplex means the microphone and speaker are open at the same time. If echo handling is not good enough, you get a loop of “interrupting yourself.” Key practices include: using a dedicated echo cancellation reference channel, time-aligning the synthesized audio, temporarily raising the interruption threshold when self-noise is detected, and dynamically constraining speaker volume. In production it is worth keeping a “conservative mode” switch that automatically falls back to weak full-duplex (only explicit speech can interrupt) when the acoustic environment is poor.
3.4 Coordinating Streaming Recognition and Streaming Synthesis
The recognition side emits incremental text with a stability marker, and the decision layer triggers generation only on “stable segments.” The synthesis side chunks audio by prosodic units, and the first chunk must be extremely short to keep first-packet latency low. The two are coordinated through a unified session state machine:
States: IDLE -> LISTENING -> THINKING -> SPEAKING -> (INTERRUPTED) -> LISTENINGCancel semantics: in-progress text chunks can be marked DISCARDED, and the corresponding synthesis queue segments are cleared immediately
The key design is retractability: any audio segment that has not yet been played should be safely discardable, and the discard operation must be idempotent to avoid duplicate playback caused by network retransmission.
3.5 Transport, Jitter, and Weak Networks
Real-time voice is more sensitive to jitter than to bandwidth. Use transport with sequence numbers and timestamps, an adaptive jitter buffer, packet loss compensation, and keyframe resynchronization. Also design session recovery for “reconnects” so users do not have to re-describe background information. On weak networks, prioritize intelligibility: lower the sample rate, shorten synthesis units, and cut unnecessary embellishment.
3.6 Evaluation, Observability, and Cost
Evaluation cannot look at average latency alone. Track first-packet latency P95, interruption success rate, false interruption rate, and turn recovery success rate. For observability, connect logging with monitoring and alerting, and record timeline markers for every session. On cost, a streaming architecture naturally supports tiering by task: simple Q&A goes to a small model or cache, complex reasoning is escalated, object storage handles audio archiving, a message queue smooths asynchronous peaks, and a container platform provides elastic scaling.
4. A Reference Implementation Skeleton
class FullDuplexSession:def __init__(self, asr, tts, dialog):self.asr, self.tts, self.dialog = asr, tts, dialogself.state = "LISTENING"self.play_queue = []def on_audio(self, frame):if self.state == "SPEAKING" and self.is_user_speech(frame):self.interrupt() # clear unplayed segments, idempotentself.asr.feed(frame)def on_partial(self, text, stable):if stable and self.state == "LISTENING" and should_yield(self.ctx):self.state = "THINKING"self.dialog.start_turn(text)def on_token(self, chunk):audio = self.tts.synthesize_stream(chunk)self.play_queue.append(audio) # can be retracted by a later interruptself.state = "SPEAKING"def interrupt(self):self.play_queue.clear()self.tts.cancel_pending()self.state = "LISTENING"
The point of this skeleton is not feature completeness but making three constraints explicit: states can transition, segments can be retracted, and interruption is idempotent.
5. Rollout Advice and Common Pitfalls
- Start narrow, then widen: begin with a single language, a single scenario, and a quiet environment, then gradually open up noisy and multi-speaker scenarios.
- A fallback path must exist: when the acoustic environment is poor or network jitter is high, automatically fall back to half-duplex; that experience beats “forcing full-duplex.”
- Put compliance and privacy first: clearly state the purpose of recording, provide mute and deletion entry points, and set retention periods and access audits for audio archives.
- Do not ignore the text fallback: when recognition confidence is low, use clarifying questions instead of guessing at answers.
- Load tests must resemble reality: replay real home, in-car, or outdoor recordings rather than clean corpora, otherwise metrics will be systematically optimistic.
If you are evaluating an upgrade from existing voice features to real-time full-duplex, you can start with small-scale validation on top of general cloud capabilities such as Baidu AI Cloud: use object storage to accumulate corpora, a message queue to decouple asynchronous tasks, and logging plus monitoring to guard latency and interruption metrics, then decide whether to widen the canary scope. The payoff of full-duplex is not that it “sounds smarter”; it is handing the pace of interaction back to the user. That is the real dividing line of third-generation voice interaction.
