simli-client
package in your project:
SimliClient
class into your project:
'YOUR_SIMLI_API_KEY'
with your actual Simli API key, and 'YOUR_FACE_ID'
with the desired face ID for your application.
handleSilence: false
to avoid
audio artifactsstart
method to set up the WebRTC connection:
Initialize(config: SimliClientConfig)
: Initializes the SimliClient with the provided configuration.start()
: Sets up the WebRTC connection and prepares for streaming.close()
: Closes the WebRTC connection and cleans up resources.sendAudioData(audioData: Uint8Array)
: Sends audio data to the server.listenToMediastreamTrack(stream: MediaStreamTrack)
: Listens to a MediaStreamTrack and sends audio data to the server. Can be used as an alternative to sendAudioData
.ClearBuffer()
: Clears the audio buffer, best used when you want the avatar to stop talking.connected
when the data channel is open and ready to usedisconnected
when the data channel is closedfailed
when the webRTC connection fails to connectspeaking
when the avatar starts speakingsilent
when the avatar stops speakingcreatePeerConnection
method in the SimliClient class.