Skip to main content
Background audio fills the silences. The agent can play a subtle thinking sound while the LLM is generating, and ambient audio (hold music, office noise) on demand, so the call never feels dead. Any libav-decodable file works: WAV, MP3, Ogg/Vorbis, Ogg/Opus, FLAC, M4A/AAC.
Pass background_audio=True to zrt.serve(...) or zrt.Room(...). An explicit file URL is required. An unset or empty file disables the audio.

Thinking audio

set_thinking_audio() plays a short sound while the agent is thinking (LLM generation). Call it in the agent’s constructor. Provide a file to play; an unset file disables the audio.

Ambient / background music

Start and stop ambient audio on demand, for example, from a function tool the LLM can call:

Parameters

set_thinking_audio(file=None, volume=0.3) play_background_audio(file=None, volume=1.0, looping=False, override_thinking=True) Call stop_background_audio() to stop ambient playback.

What’s Next

Audio Customization

Tune the agent’s voice.

Modalities Overview

Browse vision, text, and avatar modalities.

References

Examples

Background Audio

Play ambient or hold audio during a call.

SDK Reference

Background Audio

Background Audio in the Python API reference.