Skip to main content

Key Interfaces

1). Initialization

Initialize the SDK with your appId and appSecret, then obtain a Player instance:

2) Connect to the digital human

Connect using your platform conversationId:
The player exposes the following callbacks:

onShow — Digital human is ready to display

onError — Error occurred during connection

Parameters: Possible msgType values:

onVideoTrack — RTC media channel created successfully

Bind your digital human view to the track in this callback

onAudioSamples — Local audio sampling data callback

Use this callback for audio visualization or processing.

onTtsSpeakStart — TTS playback started

onTtsSpeakText — TTS text content

onTtsSpeakStop — TTS playback completed

onSpeakStart — Speaking started

onSpeakText — Spoken text content

onSpeakStop — Speaking completed

onAsrResult — ASR recognition result

3) Drive the digital human to speak with an audio URL

Use a WAV audio URL with 16 kHz sample rate, 16‑bit, mono channel to drive speech

4) Drive the digital human to speak with text

Provide text input. The digital human will speak using the session’s configured voice.

5) Q&A Interaction

Ask a question and receive a response from the digital human.

6) Interrupt speaking

Stop the current speech immediately.