Skip to content

bodhi-realtime-agent / AudioOutputObserver

Type Alias: AudioOutputObserver ​

AudioOutputObserver = (pcm, meta) => void

Defined in: src/types/session-seams.ts:11

Receives each chunk of native assistant audio (the model's own speech) as PCM, right before the session sends it to the client. Chunks dropped before delivery (by outputInterceptor.audio, in transcription mode, or for an already-finalized turn) are not observed, and neither is audio synthesized by an external TTS provider. Register with VoiceSession.observeAudioOutput.

pcm is the buffer the client receives; treat it as read-only. A throw is reported through hooks.onError and does not stop delivery.

Parameters ​

pcm ​

Buffer

meta ​

encoding ​

"pcm"

Always 'pcm' (16-bit little-endian mono): G.711 output is decoded first.

sampleRate ​

number

Sample rate of pcm: the transport's output rate.

turnId ​

string | null

Id of the turn the chunk belongs to.

Returns ​

void

Built with VitePress