Overview
The Duix SDK emits various events throughout the session lifecycle.Developers can listen to these events using the
duix.on(eventName, callback) methodto handle errors, progress updates, speech synchronization, and RTC quality monitoring.
Event Summary
| Event Name | Description |
|---|---|
| error | Uncaught error occurred |
| bye | Session ended |
| initialSuccess | Initialization successful — safe to call start() |
| show | Digital human is displayed |
| progress | Loading progress (0–100) |
| speakSection | Current incremental audio/text segment while speaking |
| speakStart | Speech playback started |
| speakEnd | Speech playback ended |
| asrStart | Single-sentence ASR started |
| asrData | Single-sentence ASR interim result |
| asrStop | Single-sentence ASR ended |
| report | Periodic RTC/network/video quality report |
Event Details
1. error
Triggered when an unexpected error occurs.
Payload
| Name | Description | data |
|---|---|---|
| 3001 | RTC connection failed | |
| 4001 | Failed to start session | |
| 4005 | Authentication failed | |
| 4007 | Server session abnormally ended | code: 100305 Model file not found |
| 4008 | Failed to get microphone stream | |
| 4009 | Browser blocked autoplay | Start muted or require user action; then unmute/resume |
progress
Indicates the current loading progress of the digital human and its resources. Returns a numeric value between 0 and 100. Payload: number ExamplespeakSection
Emitted for each incremental speech segment — typically used for real-time subtitles or streaming speech visualization. When answer() is used, this event streams continuously; for speak(), it aligns with speakStart. PayloadspeakStart
Triggered when the avatar begins speech playback. PayloadspeakEnd
Triggered when the avatar completes speech playback. Useful for synchronizing UI transitions or logic after speech completion. PayloadasrData
Triggered during active speech recognition (ASR). Each ASR cycle starts with asrStart and ends with asrStop. Use this event to display incremental transcription results. Payloadreport
Delivers a detailed periodic (once per second) network and video quality report. This event helps developers monitor RTC connection quality and performance metrics in real time. Payloadduix.start().