> ## 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

> Python API reference for Audio.

## 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

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

<ParamField path="enabled" type="bool" default="True">
  Set False to keep the configuration and play nothing.
</ParamField>

<ParamField path="mode" type="str" default="mixing">
  `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="float" default="1.0">
  Gain. 1.0 is the file as recorded; must not be negative.
</ParamField>

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

***

## run\_stt

```python theme={null}
async def run_stt(audio_stream: 'Any' = None) -> 'AsyncIterator[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="Any">
  The hook's audio stream, if it takes one. Drained and discarded.
</ParamField>

<ResponseField name="returns" type="AsyncIterator[SpeechEvent]">
  The `SpeechEvent` for this call. Nothing, outside an `stt` hook.
</ResponseField>
