Verbs

<Play>

Play an audio file, or send touch-tone digits, to the caller.

Element body

The audio URL to play. https:// URLs are fetched and cached by the platform; a relative path resolves against the platform's static asset root.

Example

<Response>
  <Play loop="2">https://cdn.example.com/audio/welcome.wav</Play>
</Response>

Attributes

Attribute Default Behaviour
loop 1 Number of times to play the file. 0 loops until the call hangs up.
digits unset Plays in-band touch-tone digits instead of (or after) audio. Charset 0-9 * # A-D w — each w is a 500 ms pause (wWww123 and similar strings work).
lengthSeconds unset VoiceML extension. When set, execution waits this many seconds after queueing playback so a fixed-length asset is not cut off by the next verb.

Notes

  • Audio URLs are pre-fetched and cached content-addressed by upstream ETag — thousands of simultaneous calls playing the same URL collapse to a single upstream fetch. To force a refresh after re-uploading at the same URL, change the URL (fingerprinted filename or query parameter).
  • Fetched bodies are validated against the URL's file extension (a .wav URL that serves HTML is rejected) and capped at 50 MiB.
  • <Play> may also be nested inside <Gather> as a prompt and inside <Pay> prompts.