PlayBackgroundFileSkill
Control background audio/video playback during calls using SWML playback actions. Two configuration modes are supported:
- Pre-configured mode (matches Python) — supply
filesand the skill emits a single tool whoseactionenum includesstart_<key>for each configured file plusstop. - Free-form mode (TypeScript-specific) — omit
filesand supplydefault_file_urland/orallowed_domains. The skill emits two tools,play_backgroundandstop_background, which accept arbitrary URLs (with optional domain allowlist).
Class: PlayBackgroundFileSkill
Tools (pre-configured mode): play_background_file (configurable via
tool_name)
Tools (free-form mode): play_background, stop_background
Env vars: None
Multi-instance: yes — set a distinct tool_name per instance.
tool_name
Custom name for the generated SWAIG tool in pre-configured mode. Required when registering multiple instances on the same agent.
files
Array of pre-configured file entries that become selectable via the tool’s
action enum. When supplied (and non-empty), the skill runs in
pre-configured mode; when omitted or empty, the skill falls back to
free-form mode.
Each entry has:
key(string, required) — unique identifier (alphanumeric, underscores, hyphens); mapped tostart_<key>in theactionenum.description(string, required) — human-readable description shown to the AI.url(string, required) — URL of the audio/video file.wait(boolean, optional, defaultfalse) — whether to wait for the file to finish playing.
default_file_url
Default audio file URL for free-form mode. When set, the file_url
parameter on the play_background tool becomes optional.
allowed_domains
Allowlist of domains for audio file URLs in free-form mode. When set, only URLs whose hostname matches or is a subdomain of one of these entries are accepted.