PlayBackgroundFileSkill

View as MarkdownOpen in Claude

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

default_file_url
string

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.

allowed_domains
string[]

List of allowed domains for audio file URLs. If set, only URLs from these domains are accepted.

1import { AgentBase, PlayBackgroundFileSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new PlayBackgroundFileSkill({
7 default_file_url: 'https://example.com/hold-music.mp3',
8 allowed_domains: ['example.com', 'cdn.example.com'],
9}));
10
11agent.run();