Skip to main content

BackgroundAudio

A sound bed the runtime plays into the room alongside the agent. Needs the room’s mixing track, Room({ background_audio: true }), like all audio that is not speech.

Options

boolean
Set false to keep the configuration and play nothing.
string
required
The file to play. Anything libav decodes — wav, mp3, ogg, flac, m4a. Empty is rejected.
boolean
Restart when the file ends instead of falling silent.
string
mixing or playback. Only mixing has a counterpart on the runtime today; playback is accepted, warned about, and treated as mixing.
number
Gain. 1.0 is the file as recorded; must not be negative.

run_stt

Yield the transcript an stt hook was called with. The shim that lets a hook written against a local STT run unchanged. STT itself runs in the agent process and only the transcript crosses, so the audio stream is empty here — draining it is allowed and yields nothing. Filtering or rewriting the text works as written; transforming the audio does not.
AsyncIterable<unknown, any, any> | null
The hook’s audio stream, if it takes one. Drained and discarded.
AsyncGenerator<SpeechEvent>