Choose a transport and a delegation mode for Qwen-Audio-Live.
Qwen-Audio-Live handles complex tasks within a full-duplex voice session. The frontend speech model carries on the conversation, delegates tasks, and can incorporate task results into its spoken replies.
Both setups start with a control WebSocket. Use it for audio, or establish a separate media connection to send and receive audio.
For the complete list of fields and JSON examples, see Client Events and Server Events.
Choose a transport
Both setups start with a control WebSocket. Use it for audio, or establish a separate media connection to send and receive audio.
- WebSocket only. Send and receive Base64-encoded PCM in WebSocket events. Omit
session.transportor set itstypetowebsocket. - WebSocket + WebRTC or AOQ. Keep the control WebSocket open to configure the session, set up the media connection, and send task requests. Once the media connection is ready, use it to send and receive audio. Receive server events over either connection.
- WebRTC. Send and receive audio over WebRTC media tracks. Set
session.transport.typetortc. Send the Offer and receive the Answer over the control WebSocket. - AOQ. Connect to an AOQ relay with the AOQ Client SDK. Set
session.transport.typetoaoq. Thesession.updatedevent on the control WebSocket carries temporary AOQ connection details. Setsession.transport.aoq.ws_audiototrueto receive a copy of downlink audio over the control WebSocket.
- WebRTC. Send and receive audio over WebRTC media tracks. Set
session.update, wait for session.updated. With WebRTC or AOQ, also wait for the media connection to be ready.
Choose who executes tasks
- Client mode (
client): Your application receives the task, invokes its own agent or service, and sends back the result. - Responses mode (
responses): The service invokes the configured backend model. The frontend model can use its result to continue the conversation.
call_id to correlate a frontend function call with its result. Use the delegation_id from the task event to submit task results. See client events, server events, and the Qwen-Audio-Live user guide.
Look up events by operation
Configure and end a session
| Operation | Client action | Server returns |
|---|---|---|
| Establish a WebSocket connection | Initiate connection | session.created |
| Configure session parameters | session.update | session.updated |
| View session usage | Listen for usage updates sent by the server every 5 seconds | session.usage.updated |
| End session | session.close | session.closed |
| Handle request errors | Troubleshoot errors returned by event | error |
Send and receive audio, subtitles, and text
| Operation | Client action | Server returns |
|---|---|---|
| Send and receive audio using pure WebSocket integration | session.input_audio.append | session.output_audio.delta |
| Mute or unmute upstream audio | session.input_audio.mute, session.input_audio.unmute | session.input_audio.muted, session.input_audio.unmuted |
| Display user transcription and model-generated subtitles | Receive and accumulate text fragments | session.input_transcript.delta, session.output_transcript.delta |
| Send text messages | session.item.create, item.type is set to message | Returns audio and captions according to the session configuration |
Handle delegated tasks and function calls
| Operation | Request or event | Associated field or acknowledgment |
|---|---|---|
| Receive an automatically dispatched task | Service sends session.delegation.created | delegation_id |
| Update task progress | Application sends session.thinking.append | session.thinking.appended |
| Prompt the user to provide additional information | Application sends session.instruction.append, filling in delegation_id for the current task | Listen for session.instructions.appended. The request name uses instruction and the acknowledgment uses instructions. Read additional information from supplements, if present, in subsequent session.delegation.created events. |
| Return Client-mode task results | Application sends session.commentary.append, filling in delegation_id | session.commentary.appended |
| Explicitly initiate backend generation | Application sends response.item.create with input, then sends response.create | response.event. The inner response.completed indicates completion of backend generation |
| Handle frontend function calls | Service sends session.event; application returns the result by sending session.item.create | call_id |