> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio

> TypeScript API reference for Audio.

## BackgroundAudio

A sound bed the runtime plays into the room alongside the agent.

Needs the room's mixing track, `Room(&#123; background_audio: true &#125;)`, like
all audio that is not speech.

### Options

```ts theme={null}
BackgroundAudio(options: BackgroundAudioOptions)
```

<ParamField path="enabled" type="boolean">
  Set false to keep the configuration and play nothing.
</ParamField>

<ParamField path="file_path" type="string" required>
  The file to play. Anything libav decodes -- wav, mp3, ogg, flac, m4a. Empty
  is rejected.
</ParamField>

<ParamField path="looping" type="boolean">
  Restart when the file ends instead of falling silent.
</ParamField>

<ParamField path="mode" type="string">
  `mixing` or `playback`. Only `mixing` has a counterpart on the runtime
  today; `playback` is accepted, warned about, and treated as `mixing`.
</ParamField>

<ParamField path="volume" type="number">
  Gain. 1.0 is the file as recorded; must not be negative.
</ParamField>

***

## run\_stt

```ts theme={null}
run_stt(audio_stream?: AsyncIterable<unknown, any, any> | null): AsyncGenerator<SpeechEvent>
```

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.

<ParamField path="audio_stream" type="AsyncIterable<unknown, any, any> | null">
  The hook's audio stream, if it takes one. Drained and discarded.
</ParamField>

<ResponseField name="returns" type="AsyncGenerator<SpeechEvent>" />
