Architecture Design Practices for Real-Time Full-Duplex Voice Interaction

    Real-time voice interaction is evolving from "speak-then-wait" to simultaneous "listen-and-speak." This article explores architectural constraints and engineering practices for building real-time full-duplex voice systems. It details how to decouple fluent conversation from reliable reasoning through a four-layer architecture, covering decision loop design, the separation of interaction and heavy inference tasks, safety controls, and client-side experience optimization. Readers will gain actionable insights into maintaining a controllable, interruptible, and natural conversation rhythm while avoiding common failure modes.

    Real-time voice interaction is shifting from “speak-then-wait” to “listen-and-speak.” For developers, the challenge lies not in single-shot recognition accuracy, but in the system’s ability to continuously process input and output simultaneously while deciding when to speak, listen, pause, be interrupted, or delegate complex tasks to the background. Starting from architectural constraints, this article explains how to decouple fluent conversation from reliable reasoning and provides actionable engineering practices.

    From Half-Duplex to Full-Duplex

    Traditional voice modes are mostly half-duplex: one party finishes, then the other generates a response. This turn-taking approach is simple to implement with clear state machines, but user interruptions force the entire segment to be discarded, causing noticeable wait times and making it difficult to handle real conversations where users add conditions while speaking.

    Full-duplex requires the listening and speaking channels to work simultaneously. Microphone audio continuously enters the system while the speaker may be playing synthesized voice. The system cannot assume “it is my turn only after the other finishes”; it must re-evaluate at every short time slice whether to: continue broadcasting, lower volume, stop immediately, only listen, or trigger external capabilities. The decision frequency must be higher than the perceivable human pause; otherwise, users will feel the system is sluggish or interrupting.

    Full-duplex does not mean “always talking loudly at the same time.” It is a capability: both channels are online, but the right to speak is controlled by policy. Silent listening, brief pauses, and politely yielding are all legitimate decisions, not failures.

    Layered Architecture

    It is recommended to split the real-time link into four layers to avoid one model doing everything.

    Perception Layer: Responsible for the acoustic front-end: echo cancellation, noise suppression, automatic gain control, endpoint detection, and voice activity detection (VAD). When the speaker is playing, the microphone mixes in its own echo. If not eliminated, the system will mistake its own voice for user interruption, causing a self-interruption loop.

    Streaming Understanding Layer: Converts audio into incremental text or semantic fragments and maintains dialogue state: current topic, unfinished intent, confirmed slots. It must support partial results and cannot wait until the end of a sentence to output.

    Interaction Decision Layer: The core of full-duplex. It consumes incremental understanding, playback progress, and tool states, outputting discrete actions: speak, continue listening, pause, interrupt, call tool, end session. Decisions should be explainable and replayable to troubleshoot “why it interrupted at this moment.”

    Generation and Execution Layer: Responsible for speech synthesis, tool calls, and recomputation. Time-consuming tasks like web search, long-chain reasoning, and code execution should not block listening and speaking. The interaction layer only maintains bridge phrases and rhythm, delegating heavy tasks to background reasoning services and stitching results back into the conversation once completed. This prevents “complete silence while thinking” and avoids exposing the high latency of large models as dead air.

    Designing the Decision Loop

    Each time slice can be viewed as a micro-decision. Inputs include at least:

    • Whether the user is vocalizing, and if so, whether it resembles an interruption rather than a cough or echo.
    • Current playback progress and whether the remaining content is critical.
    • Whether the understanding confidence is high enough to act.
    • Whether there are ongoing tool or reasoning tasks.
    • Whether safety policies require degradation or termination.

    The output does not need to be long text, but rather a control signal plus an optional short bridge phrase. For example, if a clear interruption is detected, synthesis should stop immediately, unplayed buffers discarded, and spoken content marked as “user might not have heard it all,” preventing subsequent answers from assuming the user heard everything. If it is just a short noise, it should not interrupt.

    Pausing and resuming require hysteresis: deciding to speak and immediately changing the mind causes jitter. A short window can confirm the interruption, while keeping the synthesis buffer at a very small granularity so the stop latency after confirmation remains acceptable. The larger the buffer, the slower the interruption.

    Schematic logic is as follows, illustrating the control flow rather than any specific vendor’s API:

    1. loop every tick:
    2. audio = capture_frame()
    3. features = frontend(audio, playback_reference)
    4. partial = streaming_understand(features)
    5. action = policy(partial, playback_state, tool_state, safety_state)
    6. if action == STOP_SPEAK:
    7. flush_playback()
    8. else if action == SPEAK:
    9. enqueue(synthesize(next_utterance))
    10. else if action == DELEGATE:
    11. start_background(task)
    12. enqueue(synthesize(bridge_phrase))
    13. else if action == END:
    14. close_session(reason)

    Splitting Fluency and Heavy Inference

    When retrieval or complex reasoning is needed, making the same real-time link wait synchronously will freeze the conversation. A more robust approach: the interaction model handles listening, speaking, confirmation, and progress updates; background models or services handle retrieval, planning, and long reasoning.

    When delegating, clearly define task boundaries: user’s original words, confirmed constraints, expected result format, and timeout. The frontend can use short phrases to maintain presence (e.g., stating it is verifying), but must not fabricate facts that have not returned yet. If the background fails or times out, degrade to asking a clarifying question or informing the user it cannot complete the task temporarily, rather than filling in with guesses.

    When results return to the frontend, check if the conversation has shifted. If the user has changed the topic, expired results should be discarded or confirmed before broadcasting. Concurrent delegations should be limited to prevent multiple background tasks from rewriting the same topic.

    Safety and Session Control

    The risk propagation of real-time voice is faster than text: once harmful content is synthesized and played, the cost of retraction is high. Policies should be tiered by risk, not just “pass/block.”

    Low risk: rewrite or omit sensitive details and continue. Medium risk: refuse the topic and guide to a safe range. High risk or repeated probing: actively end the session and log the reason for audit. Detection must cover both user input and content the system is about to play. Ending a session should be explicit and recoverable to a new session, avoiding continued “polite circling” on unsafe content.

    Regarding privacy, voice is sensitive data. Default to minimal retention, encrypt transmission, and require separate authorization for replay and annotation. Logs should record decisions and error types, avoiding unnecessary storage of raw audio.

    Client and Experience

    The same policy must cover web and mobile, but devices vary widely. Mobile has system audio focus, call routing, and Bluetooth headset latency; web has autoplay restrictions and audio worker thread scheduling. The client should report: playback clock, buffer depth, headphone connection status, and whether echo residuals are detected. The server uses these signals to adjust interruption thresholds, rather than using one set of fixed parameters.

    Experience goals can be written as observable metrics: first packet audible latency, stop latency after interruption, false interruption rate, missed interruption rate, connection delay after tool return, and unsafe broadcast interception rate. Without these metrics, full-duplex can easily be tuned to be “either too aggressive or too dull.”

    Engineering Practice Suggestions

    1. Acoustic reference signals must be sent back to the front-end; otherwise, echo cancellation has no reference.
    2. Synthesis and playback should use small fragments; when interrupted, discard unplayed fragments and notify the server of the actual broadcast position.
    3. Partial recognition results should only drive “whether speaking” status; do not use low-confidence text to directly call tools with side effects.
    4. Decouple tool calls from broadcasting; use bridge phrases to fill wait times, and use timeouts and cancellation tokens to prevent expired results from interrupting.
    5. Replay decision logs by session: input features, actions, and playback progress aligned on the same timeline.
    6. During grey release, first relax interruptions and tighten safety, then tighten acoustic thresholds based on false interruption data.
    7. If free and paid tiers use different real-time model specs, differences should be reflected in concurrency, audio quality, or inference quota, not in safety baselines. Safety policies should be consistent.

    Common Failure Modes

    Self-interruption: Echo is mistaken for user voice. Check reference signals and headset scenarios first before looking at the model.

    Over-talking (Interruption): Endpoint detection is too aggressive or the decision window is too short. Increase confirmation counts for short energy pulses.

    Missing interruptions: Playback buffer is too large or endpoint detection is turned off during playback. Detection must remain active during playback, though thresholds can be slightly raised.

    Hallucinated follow-ups: The fluency model fabricates responses before background results return. Bridge phrases can only express status, not supplement unverified conclusions.

    Safety only on input side: Sentences about to be broadcast must also pass policy, especially when tool results are directly converted to speech.

    Summary

    The value of full-duplex real-time voice lies in transforming the right to speak from fixed turns to continuous decisions, while keeping heavy reasoning in the background and letting the frontend maintain an interruptible, pausable, and terminable conversation rhythm. In implementation, prioritize echo cancellation, small buffers, replayable decision logs, and tiered safety before pursuing more natural timbre and phrasing. By layering according to these boundaries, the system remains controllable even when listening and speaking happen in parallel.