Overview
This Quick Start guide demonstrates how to initialize the Duix Android SDK,set up rendering, and establish a real-time connection with the digital human.
Before integration, ensure your app requests microphone permission dynamically at runtime,
as it is required for real-time voice communication.
Example Code (Kotlin)
How It Works
-
Initialize EGL context
TheEglBaseContextis used to handle OpenGL rendering for the digital human view. -
Initialize SDK
CallVirtualFactory.init(appId, appSecret)before creating a player instance. -
Create Player Instance
TheVirtualFactory.getPlayer()method returns aPlayerobject that manages RTC sessions and digital human rendering. -
Register Callbacks
ThePlayer.Callbackinterface provides hooks for video display, ASR recognition, and error handling. -
Connect to Session
Useplayer.connect(conversationId)to start interacting with the digital human in real time. -
Clean Up
Release resources inonDestroy()to prevent memory leaks.
Notes
- The microphone permission must be granted before calling
VirtualFactory.getPlayer(). - The digital human video stream uses WebRTC under the hood — ensure your device supports it.
- For stable rendering, set
SCALE_ASPECT_FILLand disable hardware scaling if visual artifacts occur. - Network interruptions or invalid credentials may trigger callback errors in
onError().
Now!
You can have a real-time voice conversation with the digital human through your device’s microphone.