***

title: PlayBackgroundFileSkill
slug: /reference/typescript/agents/skills/play-background-file
description: Control background audio playback during calls.
---------------------

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

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

Control background audio playback during calls. Play hold music, ambient sounds,
or any audio file using SWML playback actions.

**Class:** `PlayBackgroundFileSkill`

**Tools:** `play_background`, `stop_background`

**Env vars:** None

<ParamField path="default_file_url" type="string" toc={true}>
  Default audio file URL to use when no URL is specified by the caller.
  When set, the `file_url` parameter becomes optional on the `play_background` tool.
</ParamField>

<ParamField path="allowed_domains" type="string[]" toc={true}>
  List of allowed domains for audio file URLs. If set, only URLs from these
  domains are accepted.
</ParamField>

```typescript {6-9}
import { AgentBase, PlayBackgroundFileSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new PlayBackgroundFileSkill({
  default_file_url: 'https://example.com/hold-music.mp3',
  allowed_domains: ['example.com', 'cdn.example.com'],
}));

agent.run();
```