init(option: object): Promise
Parameters
start(option:object): Promise
Calling thestart method will begin rendering the digital human and initiate interaction.
Note: This method needs to be called after theParametersintialSucccessevent is triggered. TheintialSucccessevent indicates that all resources are prepared. As follows:
setVideoMuted(flag:boolean)
Set whether the digital human video is muted, true is muted, false is unmuted.break()
Interrupt the digital human speakingspeak(option: Object): Promise
Drive the digital human to speak, supporting text-driven and audio file-driven modes.answer(option: Object): Promise
Digital human answers a questiongetAnswer(option: Object): Promise
Get the answer to a question from the platform
Return data
startRecord():Promise
Start recording.stopRecord():Promise
End recording. After successful recording, it will return the speech recognition result (text) and return a Promise.openAsr():Promise
Enable real-time speech recognition (note that this method needs to be called when the show event is triggered). After enabling real-time speech recognition, you can monitor theasrResult event to receive recognition (text) results.
closeAsr():Promise
Close real-time speech recognition.stop()
Stop the current session. It is recommended to call this method in the page unload event to prevent resources from not being released in time when refreshing or closing the webpage.getLocalStream()
Get the local audio stream, which is convenient for external audio visualization and other functionsgetRemoteStream()
Get the remote audio and video stream, which is convenient for external customizationresume()
Resume playback, currently only for some mobile browsers where even if autoplay is triggered by user operation, it still doesn’t work. Triggering the resume method through user operation in the 4009 error can solve this.on(eventname, callback)
Listen for events.Parameters
eventname
Event name, see the table below for details.callback
Callback functionReturn Format Description
For methods that returnPromise, the parameter format is { err, data }. If err is not empty, it means the call failed.