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.

Fields

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

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.
Any
The hook’s audio stream, if it takes one. Drained and discarded.
AsyncIterator[SpeechEvent]
The SpeechEvent for this call. Nothing, outside an stt hook.