state: TruGenState
Fired when the session connection state changes (e.g., to
CONNECTED, DISCONNECTED).void
Fired when the WebRTC connection is successfully established.
(code: ConnectionClosedCode, reason: string)
Fired when the session connection is terminated.
track: RemoteVideoTrack
Fired when the remote video track from the avatar becomes available.
track: RemoteAudioTrack
Fired when the remote audio track from the avatar becomes available.
stream: MediaStream
Fired when the client microphone input stream is initialized.
void
Fired when the avatar starts speaking.
void
Fired when the avatar finishes speaking.
void
Fired when the user starts speaking. Useful for showing an active speaking or listening indicator in the UI.
void
Fired when the user finishes speaking.
void
Fired when the user interrupts the avatar’s speech.
payload: { text: string; isFinal: boolean; role: string; }
Fired when real-time transcription/captions chunks are received.
void
Fired when the browser is requesting microphone permissions.
void
Fired when microphone permissions are granted.
error: string | Error
Fired when microphone permissions are denied by the user or browser.
deviceId: string
Fired when the active input audio capture device is changed.
error: any
Fired when any WebRTC or connection errors occur.