> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# play_background_file

> Play an audio or video file in the background during a call.

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

Play an audio or video file in the background while the conversation continues.

## **Parameters**

**`filename`** `str` — required

URL of the audio or video file to play (e.g., `"https://example.com/hold-music.mp3"`).

---

**`wait`** `bool` — default: False

When `True`, suppresses the agent's attention-getting behavior during playback.
The agent will not try to re-engage the user while the file is playing.

---

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {11}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="play_hold_music", description="Play hold music in the background")
def play_hold_music(args, raw_data):
    return (
        FunctionResult("Please hold.")
        .play_background_file(
            "https://example.com/hold-music.mp3",
            wait=True
        )
    )

agent.serve()
```