Skip to main content

1. Initialization

Initialize the module with the appId and appSecret provided in your platform account and get the Play object

2. Connect to Digital Human

Connect to the digital human using the conversationId provided by your platform account
The callback contains the following callbacks

onShow Digital human is ready to display

onError Exception occurred when connecting to digital human

Parameter description: Values of msgType:

onVideoTrack RTC media channel created successfully

Bind the digital human widget to the track in this callback

onAudioSamples Local audio sampling data callback

You can implement audio visualization and other operations in this callback

onTtsSpeakStart Digital human starts playing TTS synthesized audio

onTtsSpeakText Text content of TTS played by digital human

onTtsSpeakStop TTS text playback completed

onSpeakStart Digital human starts speaking

onSpeakText Text content spoken by digital human

onSpeakStop Digital human finished speaking

onAsrResult ASR recognition content callback

3. Drive Digital Human to Speak with Audio URL

Use a WAV audio URL with 16kHz sampling rate, 16bit, mono channel to drive the digital human to speak

4. Drive Digital Human to Speak with Text

Input the text that you want the digital human to say, and the digital human will say the corresponding content according to the voice configured in the session.

5. Digital Human Q&A

Let the digital human answer your questions.

6. Interrupt Digital Human Speaking

Make the digital human stop talking