I. What Is Real-Time Voice Interaction?
Real-time Voice Interaction means a user communicates with an AI system through continuous, two-way, low-latency speech.
Compared with traditional voice assistants, real-time voice interaction is not simply converting speech to text and then generating a spoken answer. It has to handle a series of events that occur continuously:
- The user starts speaking.
- The system receives audio in real time.
- It determines whether the user is currently speaking.
- It recognizes the speech content.
- It understands the user's intent.
- It generates a reply.
- It converts the reply into speech.
- It keeps playing audio to the user.
- It supports the user interrupting midway.
- It adjusts the current response based on new input.
The most important difference here is: real-time voice interaction is a continuously running interactive system, not a one-off speech-to-text task.
1. Traditional Voice Assistants vs. Real-Time Voice Interaction
| Comparison Dimension | Traditional Voice Assistant | Real-Time Voice Interaction |
|---|---|---|
| Input method | Usually a single recording | Continuous audio stream |
| Interaction mode | One question, one answer | Continuous two-way conversation |
| Speech recognition | Usually after a complete recording | Can recognize while receiving |
| Response method | Play after generating a complete answer | Can play while generating |
| Interruption capability | Usually weak | Supports real-time interruption |
| Context | Mostly single-turn requests | Continuously maintains conversation state |
| Latency requirements | Relatively loose | Sensitive to end-to-end latency |
| Tool calling | Usually triggered by a fixed flow | Can be decided dynamically based on the conversation |
| System complexity | Relatively simple | Involves audio, models, networking and state scheduling |
2. What Is a Voice Agent?
A Voice Agent is an agent system that uses voice as its primary interaction interface and is capable of perceiving user input, understanding tasks, planning the execution process and generating spoken responses.
It not only needs to recognize what the user said, but also needs to decide what to do next.
For example, the user says:
Check the weather for tomorrow afternoon. If it's going to rain, remind me to bring an umbrella.
A complete voice Agent needs to:
- Receive and recognize the user's speech.
- Understand the two tasks: querying the weather and setting a reminder.
- Determine that a weather tool needs to be called.
- Obtain tomorrow's weather information.
- Decide whether to create a reminder based on the weather result.
- Call the reminder tool.
- Organize the execution results into natural language.
- Generate speech through TTS and return it.
This is no longer just speech recognition and speech synthesis, but an Agent with tool-calling and task-execution capabilities.
II. The Overall Architecture of Real-Time Voice Interaction
A real-time voice system usually consists of an audio access layer, a voice perception layer, an intelligent decision layer, a voice generation layer and a communication transport layer.
1. Traditional Cascaded Architecture
Traditional voice Agents usually adopt a Cascaded Architecture.
It combines several independent models:
- VAD: voice activity detection.
- ASR: automatic speech recognition.
- LLM: language understanding and generation.
- Tool Calling: tool invocation.
- TTS: speech synthesis.
Overall structure:
flowchart TD
A["User voice input"] --> B["Audio capture"]
B --> C["VAD voice activity detection"]
C --> D["ASR speech recognition"]
D --> E["Text and context"]
E --> F["LLM intent understanding and reasoning"]
F --> G{"Whether tool calling is required"}
G -->|"Yes"| H["Tool Calling"]
H --> I["Tool execution"]
I --> J["Tool result"]
J --> F
G -->|"No"| K["Generate response text"]
F --> K
K --> L["TTS speech synthesis"]
L --> M["Audio stream output"]
M --> N["User playback"]
style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style B fill:#EAF3EC,stroke:#83A995,color:#315D49
style C fill:#EAF3EC,stroke:#83A995,color:#315D49
style D fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style E fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style F fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style G fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
style H fill:#EAF3EC,stroke:#83A995,color:#315D49
style I fill:#EAF3EC,stroke:#83A995,color:#315D49
style J fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style K fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style L fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style M fill:#EAF3EC,stroke:#83A995,color:#315D49
style N fill:#E5F0E9,stroke:#83A995,color:#315D49
The advantage of this architecture is that module responsibilities are clear, and ASR, LLM, and TTS can be replaced independently.
For example:
- ASR uses Whisper or Paraformer.
- LLM uses GPT, Claude, Gemini, or other models.
- TTS uses VITS, CosyVoice, or commercial speech services.
But the cascaded architecture also has obvious problems:
- ASR recognition errors are propagated to the LLM.
- Text conversion loses some speech information.
- There is extra transmission and scheduling overhead between ASR, LLM, and TTS.
- Each module needs to maintain context independently.
- Multiple models executing serially increases response latency.
2. End-to-End Speech Interaction Architecture
End-to-end speech interaction (End-to-End Speech-to-Speech) attempts to directly establish a mapping between audio input and audio output.
flowchart TD
A["User voice input"] --> B["Audio encoder"]
B --> C["Speech representation"]
C --> D["Multimodal model"]
E["Dialogue context"] --> D
D --> F["Speech generation representation"]
F --> G["Audio decoder"]
G --> H["Generated speech"]
H --> I["Real-time audio playback"]
style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style B fill:#EAF3EC,stroke:#83A995,color:#315D49
style C fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style D fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style E fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
style F fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style G fill:#EAF3EC,stroke:#83A995,color:#315D49
style H fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style I fill:#E5F0E9,stroke:#83A995,color:#315D49
An end-to-end architecture does not necessarily need to explicitly output complete text before performing speech synthesis.
The model can directly use the speech, intonation, and other acoustic information in the audio input for understanding and generate speech output.
Potential advantages:
- Reduces transmission between independent modules.
- Lowers the latency of some cascaded processes.
- Preserves more prosodic and paralinguistic information in speech.
- Supports more natural speech interaction.
- Has the opportunity to achieve more unified multimodal understanding and generation.
But end-to-end does not mean there is no module division inside the system, nor does it mean all tool calls, business logic, and permission control are handled by the model.
Actual systems still require independent session management, tool execution, communication, and security control layers.
III. Real-Time Audio Capture and Transmission
Real-time voice interaction first requires solving how audio data is continuously captured and transmitted.
1. Audio Capture
What a microphone captures is a continuous analog sound signal.
A computer needs to convert it into digital audio:
- Sampling.
- Quantization.
- Encoding.
Common audio parameters:
| Parameter | Common Values | Purpose |
|---|---|---|
| Sample rate | 16 kHz, 24 kHz, 48 kHz | Determines the number of samples per second |
| Bit depth | 16-bit, 24-bit | Determines the quantization precision of each sample point |
| Channels | Mono, Stereo | Determines the number of audio channels |
| Encoding | PCM, Opus, AAC | Determines how audio data is represented |
| Frame length | 10 ms, 20 ms, 40 ms | Determines the audio chunking granularity |
Speech recognition models generally do not require a particularly high audio sample rate, but the specific requirements depend on the audio configuration used when the model was trained.
If the model requires 16 kHz input while the capture device outputs 48 kHz, true resampling is required, rather than simply modifying the sample rate metadata.
2. Why Are Audio Chunks Needed?
If audio is uploaded only after the user finishes speaking a complete sentence, true low-latency interaction cannot be achieved.
Therefore, systems usually split continuous audio into multiple small chunks (Audio Chunk).
For example:
Audio Stream
↓
Chunk 1: 0 ~ 20 ms
Chunk 2: 20 ~ 40 ms
Chunk 3: 40 ~ 60 ms
Chunk 4: 60 ~ 80 ms
↓
Continuous sending
Each Chunk is an independent piece of audio data.
Assume:
- The sample rate is 16 kHz.
- Mono.
- PCM 16-bit.
- Each Chunk is 20 ms.
Then the number of sample points in each Chunk is:
Each sample point occupies 2 Bytes, so the data size of a single Chunk is:
This does not yet include extra overhead such as network protocols and message encapsulation.
3. Trade-offs in Chunk Size
| Chunk Size | Advantages | Disadvantages |
|---|---|---|
| Smaller | Low transmission latency, responsive | More messages, higher protocol overhead |
| Larger | Higher transmission efficiency | Increased wait time before initial processing |
If Chunks are too small, message processing, scheduling, and network overhead increase.
If Chunks are too large, the system spends more time waiting for data.
Therefore, real systems need to choose an appropriate chunk size based on the network environment, model processing capability, and real-time requirements.
4. Real-Time Transport Protocols
Common real-time audio transport technologies include:
WebSocket
- Based on TCP.
- Supports bidirectional communication.
- The client and server can continuously send messages.
- Suitable for transmitting audio Chunks, text events, and control messages.
WebRTC
- Designed for real-time audio and video communication.
- Supports low-latency media transport.
- Provides capabilities such as network adaptation, jitter buffering, and congestion control.
- Suitable for browsers, mobile clients, and real-time audio/video scenarios.
HTTP + SSE
- Based on HTTP.
- SSE primarily provides server-to-client event streams.
- Suitable for continuous server-side push of text, status, and partial generation results.
- It is not natively suitable for bidirectional audio transmission and usually requires an additional uplink channel.
It should be noted that WebSocket and WebRTC are not simply interchangeable.
WebSocket is suitable for application-layer bidirectional message communication; WebRTC is better suited to real-time media transport, especially in scenarios sensitive to latency and network fluctuations.
IV. VAD: Voice Activity Detection
VAD (Voice Activity Detection) is used to determine whether human speech is present in audio.
It is a very important foundational module in real-time voice interaction.
1. Why Is VAD Needed?
Not all audio captured by the microphone is the user speaking.
It may include:
- Ambient noise.
- Keyboard sounds.
- Fan noise.
- Background music.
- Breathing sounds.
- Silence.
- User speech.
If all audio is passed directly to ASR or a speech model for processing, it will incur additional computational overhead and may also affect recognition results.
VAD can help the system determine:
- Whether the user has started speaking.
- Whether the user is still speaking.
- Whether the user has stopped speaking.
2. Basic Principles of VAD
Traditional VAD can use short-term energy, zero-crossing rate, and spectral features to determine voice activity.
Modern VAD usually uses neural networks to learn the differences between speech and non-speech.
The system can output a speech probability for each audio frame:
When the probability exceeds the set threshold, the current frame can be classified as speech.
For example:
The 0.5 here is only an illustrative threshold; the actual threshold needs to be configured based on the model and environment.
3. VAD and Endpoint Detection
VAD mainly determines whether the current audio frame contains speech.
Endpoint Detection further determines whether an utterance has ended.
For example:
User starts speaking
↓
Speech detected
↓
Continue receiving speech
↓
Brief silence detected
↓
Keep waiting
↓
Silence exceeds the end threshold
↓
Determine that the current utterance has ended
The two are not exactly the same.
VAD is a frame-level speech activity judgment, whereas Endpoint Detection usually needs to make decisions based on consecutive frames, silence duration, and dialogue state.
4. Silence Thresholds and Misjudgments
If the end-silence threshold is set too short:
- A brief pause by the user may be judged as the end.
- The system may start answering too early.
- The user's subsequent additional content may be cut off.
If the threshold is set too long:
- The system keeps waiting after the user has finished speaking.
- The initial response latency increases.
- The conversation appears less natural.
Therefore, VAD and Endpoint Detection need to work together with linguistic context and interaction strategies.
V. ASR: Real-Time Speech Recognition
ASR (Automatic Speech Recognition) is responsible for converting user speech into text.
In a real-time voice agent, ASR needs not only to recognize the final text but also to support incremental recognition.
1. Streaming ASR
Traditional ASR usually performs recognition after receiving the complete audio.
Streaming ASR, by contrast, allows the system to continuously receive audio and output recognition results incrementally.
For example:
Audio input:
I want to check the weather in Beijing tomorrow.
Recognition process:
I
I want
I want to check
I want to check tomorrow
I want to check tomorrow in Beijing
I want to check the weather in Beijing tomorrow
These intermediate results may change as subsequent audio arrives.
Therefore, streaming ASR usually needs to distinguish between:
- Partial Result: temporary recognition result.
- Final Result: final confirmed result.
2. Difference Between Partial and Final
Suppose the user says:
I want to go to Shanghai Bank.
During recognition, the system may first output:
I want to go to Shanghai
Later, it may recognize it as:
I want to go to Shanghai Bank
The first result is only a temporary result and does not necessarily represent the complete meaning.
If the LLM immediately performs complex tasks on every Partial Result, it may produce duplicate requests or incorrect decisions.
Therefore, the system needs to clarify which events can trigger model inference and which are only for real-time display.
3. Challenges of Streaming Recognition
- Speech context is incomplete.
- Homophones need subsequent speech for disambiguation.
- The user may change their expression midway.
- Recognition results may be corrected.
- The end time of a sentence is difficult to determine accurately.
- Overlapping speech from multiple people increases recognition difficulty.
In a voice agent, ASR also needs to work in coordination with VAD, Endpoint Detection, and dialogue state management.
VI. Turn-taking: Conversation Turn Management
Turn-taking is a key mechanism in real-time voice interaction, referring to how the system determines whether the user should speak now or the AI should answer.
Traditional chat systems have very clear interaction boundaries:
The user sends a message, and the model generates a response.
Real-time voice interaction is more complex.
The user may:
- Wait after finishing a sentence.
- Pause halfway through speaking.
- Change their mind midway.
- Continue adding information while the AI is answering.
- Interrupt the AI proactively.
- Continue speaking after several brief pauses.
Therefore, the system must maintain clear conversation turn states.
1. Common Conversation States
The following states can be designed:
| State | Meaning |
|---|---|
| IDLE | Idle, waiting for user input |
| LISTENING | Receiving user speech |
| PROCESSING | Understanding and processing the user request |
| RESPONDING | Generating a response |
| SPEAKING | Playing AI speech |
| INTERRUPTED | Current response interrupted |
| ERROR | An exception occurred |
2. State Transitions
stateDiagram-v2
[*] --> IDLE
IDLE --> LISTENING: User speech detected
LISTENING --> PROCESSING: User turn ends
PROCESSING --> RESPONDING: Start generating response
RESPONDING --> SPEAKING: Playable audio received
SPEAKING --> IDLE: Response playback complete
SPEAKING --> INTERRUPTED: User interrupts
RESPONDING --> INTERRUPTED: Interrupted during generation
INTERRUPTED --> LISTENING: Continue receiving user speech
PROCESSING --> ERROR: Processing failed
RESPONDING --> ERROR: Generation failed
ERROR --> IDLE: Resume session
This state diagram describes a typical design; it does not mean that all voice agents must use exactly the same set of states.
3. Why Can't We Rely Only on Silence Detection?
The user finishing speaking does not necessarily mean they want the AI to answer immediately.
For example:
User: Check tomorrow's weather for me…
Pause 300 ms
User: And the day after tomorrow too.
If the system triggers a response immediately after the first pause, it may split the user's complete intent into two requests.
Therefore, turn-taking needs to take the following into account:
- VAD results.
- Silence duration.
- ASR recognition results.
- Sentence completeness.
- Probability that the semantic turn has ended.
- Whether the user still holds the speaking turn.
- Whether the AI is currently speaking.
This is also why real-time voice interaction requires a dedicated dialogue management layer.
VII. Barge-in: The User Interruption Mechanism
Barge-in is a critical capability of real-time voice systems, meaning the user can actively interrupt while the AI is speaking.
For example:
AI: Tomorrow's weather in Beijing is sunny, with a high of…
User: Never mind, I want to check Shanghai.
The system needs to immediately stop or cancel the current response and begin processing the user's new request.
1. The Complete Interruption Flow
flowchart TD
A["AI is generating speech"] --> B["Continuously listen to user audio"]
B --> C["VAD detects user speech"]
C --> D["Determine whether it is a valid interruption"]
D --> E{"Interruption confirmed?"}
E -->|"No"| F["Continue playing current audio"]
F --> B
E -->|"Yes"| G["Stop current audio playback"]
G --> H["Cancel current generation task"]
H --> I["Clear unplayed audio buffer"]
I --> J["Receive complete user input"]
J --> K["Re-interpret user intent"]
style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style B fill:#EAF3EC,stroke:#83A995,color:#315D49
style C fill:#EAF3EC,stroke:#83A995,color:#315D49
style D fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style E fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
style F fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style G fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style H fill:#EAF3EC,stroke:#83A995,color:#315D49
style I fill:#EAF3EC,stroke:#83A995,color:#315D49
style J fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style K fill:#E5F0E9,stroke:#83A995,color:#315D49
2. Why Is Interruption More Than Just Stopping Playback?
Many people understand barge-in as pausing the audio player.
In reality, a complete interruption involves at least four layers:
First, stop client-side playback.
Playing audio must stop immediately, and any buffer that has not yet been played must be cleared.
Second, cancel server-side generation.
If the LLM or TTS is still generating, the corresponding task must be cancelled to avoid wasting compute resources.
Third, manage message state.
It must be made explicit that the current reply has been interrupted, and the remaining content must no longer be sent as a normal response.
Fourth, handle the new round of user input.
After the interruption, the system needs to treat the new speech as new input and re-run recognition and intent understanding.
3. Handling Audio Buffering and Generation Race Conditions
There is an easily overlooked problem in real-time systems:
The client stopping playback does not mean the server has stopped sending data.
For example:
- The AI is generating the 10th audio chunk.
- The user triggers an interruption.
- The client clears the playback queue.
- The server then sends the 11th chunk, which was generated earlier.
- The client mistakenly plays the old audio.
One solution is to introduce a response ID or generation round ID.
For example:
Response ID: 1001
Audio Chunk: 1, 2, 3…
User interrupts
Response ID: 1002
Audio Chunk: 1, 2, 3…
The client only accepts audio data corresponding to the currently valid Response ID.
This prevents data from old responses from contaminating the new round of playback.
VIII. LLM: The Decision-Making Core of a Voice Agent
The LLM in a voice agent is responsible for understanding user intent, maintaining context, deciding whether to call tools, and organizing responses.
Unlike ordinary text chat, the input to a voice agent usually comes from ASR or a multimodal audio model, and the output must also take voice expression into account.
1. Intent Understanding
For example:
User:
Check tomorrow's weather in Shanghai for me.
The LLM needs to identify:
- Intent: query the weather.
- Location: Shanghai.
- Date: tomorrow.
- Action: call the weather query tool.
It needs to convert natural language into a structured task.
2. Context Management
Real-time voice interaction is usually multi-turn dialogue.
For example:
User: What will the weather be like in Beijing tomorrow?
AI: Beijing is expected to be sunny tomorrow.
User: What about Shanghai?
AI: Shanghai is expected to be cloudy tomorrow.
The second question did not explicitly mention the date.
The system needs to recover from the context:
- The current query subject is still weather.
- The time is still tomorrow.
- The user only changed the location.
Therefore, the voice agent needs to maintain the conversation history and necessary structured state.
3. Conversation Context Structure
A structure similar to the following can be used to manage the session:
{
"session_id": "session_001",
"turn_id": 12,
"history": [
{
"role": "user",
"content": "明天北京天气怎么样?"
},
{
"role": "assistant",
"content": "明天北京预计晴天。"
},
{
"role": "user",
"content": "那上海呢?"
}
],
"context": {
"intent": "weather_query",
"date": "明天",
"location": "上海"
}
}
In a real system, relative times such as dates usually need to be converted into explicit dates, taking the user's time zone into account.
In addition, turn_id, session_id, and response ID should be managed separately to avoid conflating sessions, user turns, and generation tasks.
4. Conversation State and Long-Term Memory
A voice agent can maintain two different types of information:
Short-term conversation state:
- The task currently being executed.
- The current topic.
- The last few conversation turns.
- The current tool call results.
- Operations that have not yet been completed.
Long-term memory:
- Preferences the user has explicitly allowed to be saved.
- Frequently used locations.
- Frequently used services.
- Long-term context actively provided by the user.
Long-term memory requires explicit authorization, access control, and deletion mechanisms; not all voice content should be retained permanently by default.
IX. Function Calling: Tool Calls for Voice Agents
A voice agent that can actually execute tasks usually needs to connect to external tools.
Function Calling allows an LLM to generate structured tool-call requests based on user intent.
Pay particular attention to this:
The model generating a tool-call request does not mean the tool has already been executed.
Actual execution requires the application to parse the request, check permissions, call the tool, and then return the result to the model.
1. Tool Call Example
The user says:
Check the weather in Shanghai today.
The model might generate a structure like this:
{
"name": "get_weather",
"arguments": {
"location": "上海",
"date": "今天"
}
}
After receiving the call request, the application needs to:
- Check whether the tool name is in the allowed list.
- Validate the parameter format.
- Check whether the user has execution permission.
- Call the weather service.
- Obtain the execution result.
- Return the result to the model.
2. Complete Tool Call Process
flowchart TD
A["User voice request"] --> B["ASR or audio understanding"]
B --> C["LLM understands intent"]
C --> D{"Is a tool needed?"}
D -->|"No"| E["Generate response directly"]
D -->|"Yes"| F["Generate Tool Call"]
F --> G["App parses and validates parameters"]
G --> H["Permission and business validation"]
H --> I["Execute external tool"]
I --> J["Tool returns result"]
J --> K["Return result to LLM"]
K --> L["Generate natural language response"]
E --> M["TTS"]
L --> M
M --> N["Voice output"]
style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style B fill:#EAF3EC,stroke:#83A995,color:#315D49
style C fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style D fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
style E fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style F fill:#EAF3EC,stroke:#83A995,color:#315D49
style G fill:#EAF3EC,stroke:#83A995,color:#315D49
style H fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
style I fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style J fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style K fill:#EAF3EC,stroke:#83A995,color:#315D49
style L fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style M fill:#EAF3EC,stroke:#83A995,color:#315D49
style N fill:#E5F0E9,stroke:#83A995,color:#315D49
3. Tool Call Optimization in Voice Scenarios
Voice interaction is more sensitive to tool call latency.
For example, a user asks:
What time is it?
If the system first generates a long block of reasoning content, then calls the time tool, and only then begins to answer, it will feel sluggish.
You can optimize it in the following ways:
- Streamline tool descriptions and parameter structures.
- Identify clear intents as early as possible.
- Use low-latency tool services.
- Execute independent queries in parallel.
- Separate tool execution status from user-visible responses.
- Provide brief progress feedback for long-running tasks.
However, you must not skip permission checks, parameter validation, or user confirmation just to reduce latency.
In particular, for operations with side effects such as transfers, data deletion, and message sending, confirmation mechanisms need to be designed based on risk.
10. Real-Time TTS: From Text to Audio Stream
In real-time voice interaction, TTS does not necessarily need to wait until the complete response is generated before it starts working.
A more ideal approach is:
The LLM generates text incrementally, and TTS receives the text synchronously and generates audio chunks.
1. Text Stream and Audio Stream
For example, the LLM outputs incrementally:
Tomorrow
Tomorrow Beijing
The weather in Beijing tomorrow
The weather in Beijing tomorrow is expected to be sunny.
TTS can start generating audio after obtaining sufficient text context.
In this way, the system does not need to wait for the entire text to be fully generated.
2. Streaming TTS Architecture
flowchart TD
A["LLM Token Stream"] --> B["Incremental text aggregation"]
B --> C["Text segmentation and context determination"]
C --> D["Streaming TTS generation"]
D --> E["Audio Chunk"]
E --> F["Audio buffer queue"]
F --> G["Client playback"]
H["Playback state and interruption events"] --> F
style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style B fill:#EAF3EC,stroke:#83A995,color:#315D49
style C fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style D fill:#DCEFE5,stroke:#4F8B70,color:#24563F
style E fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
style F fill:#EAF3EC,stroke:#83A995,color:#315D49
style G fill:#E5F0E9,stroke:#83A995,color:#315D49
style H fill:#F7F4E8,stroke:#C7B77A,color:#675A2D