This topic describes the client events for the qwen3-livetranslate-flash-realtime API.
Reference: Real-time audio and video translation - Qwen.
session.update
After you establish a WebSocket connection, send this event to update the default session configuration.
After the service receives the session.update event, it validates the parameters. If the parameters are invalid, the service returns a fault. If the parameters are valid, the service updates and returns the complete configuration.
type The event type. This must be set to | |
session The session configuration. |
input_audio_buffer.append
This event appends audio bytes to the input audio buffer. The service uses this buffer to detect speech and determine when to submit it.
type The event type. This must be set to | |
audio The Base64-encoded audio data. |
input_image_buffer.append
This event adds image data to the image buffer. The image can be from a local file or captured in real-time from a video stream.
The following limits apply to image inputs:
The image format must be JPG or JPEG. For optimal performance, a resolution of 480p or 720p is recommended. The maximum resolution is 1080p.
The size of a single image cannot exceed 500 KB before Base64 encoding.
The image data must be Base64-encoded.
The frequency for adding images to the buffer must not exceed 2 images per second.
You must send at least one input_audio_buffer.append event before you send an input_image_buffer.append event.
type The event type. This must be set to | |
image The Base64-encoded image data. |
session.finish
Send this event to end the current session. After you send this event, the server responds as:
If speech is detected: The server completes speech recognition and sends a conversation.item.input_audio_transcription.completed event with the recognition result. Then, it sends a session.finished event to indicate that the session has ended.
No speech detected: The server-side sends the
session.finishedevent directly.
The client must disconnect after receiving the session.finished event.
type The event type. This must be set to | |