Overview
The following diagram illustrates the Duix H5 SDK call flow,showing how each method and event connects within a real-time digital human session.
This helps developers understand when to initialize, start, interact, and properly close the session.
SDK Call Flow

Lifecycle Summary
Below is a simplified description of the SDK’s execution lifecycle:-
Initialize
Callduix.init()with the required configuration (sign,containerLable,conversationId,platform). -
Wait for Initialization Event
Listen for theinitialSuccessevent to confirm all resources have loaded. -
Start the Session
Invokeduix.start()to begin rendering the digital human and enable audio/video streaming. -
Interact in Real Time
- Use
duix.speak()orduix.answer()for text/audio-based responses. - Enable or disable speech recognition via
duix.openAsr()/duix.closeAsr(). - Monitor lifecycle events such as
speakStart,speakEnd,asrData, andreport.
- Use
-
Handle User Actions & Network Events
- Respond to
errororreportevents for network diagnostics. - Use
duix.break()to interrupt speech orduix.setVideoMuted()to toggle playback.
- Respond to
-
Terminate the Session
- When done, call
duix.stop()to gracefully release all WebRTC resources. - Optionally bind
duix.stop()towindow.beforeunloadfor page refresh or close.
- When done, call
Best Practices
- Always register event listeners before calling
duix.start(). - For browsers with autoplay restrictions, start muted (
muted: true) and later unmute viasetVideoMuted(false). - If using green-screen background removal (
wipeGreen: true), ensure the input video uses a pure green background during session creation. - To maintain performance, stop the session (
duix.stop()) when inactive for long periods.
Tip:
Pair this diagram with the Methods and Events sections
to see both the functional flow and event sequence.