play

View as MarkdownOpen in Claude

Add a play verb to the main section. Plays audio from a URL or a list of URLs.

Parameters

config
Record<string, unknown>Required

SWML play verb configuration object. Keys are passed through to the SWML document as-is (snake_case). Exactly one of url or urls must be provided.

KeyTypeDescription
urlstringSingle URL to play. Supports the say: prefix for TTS
urlsstring[]List of URLs to play in sequence
volumenumberVolume adjustment (-40 to 40 dB)
say_voicestringVoice name for text-to-speech
say_languagestringLanguage code for TTS (e.g., "en-US")
say_genderstringGender for TTS voice selection
auto_answerbooleanAuto-answer the call before playing

Returns

this — The builder instance for method chaining.

Example

1import { SwmlBuilder } from '@signalwire/sdk';
2
3const builder = new SwmlBuilder();
4builder.addVerb('answer', {});
5builder.play({ url: 'https://example.com/audio.mp3' });