Play element plays an audio file from a remote URL to the caller. Vobiz supports MP3 and WAV audio files. The audio URL is the text content of the element, not an attribute.
Play runs to completion before Vobiz moves to the next element, unless the caller hangs up. It posts no parameters of its own to any URL.
Attributes
loop (integer)
The number of times to play the audio file. Set to 0 to play indefinitely (until the caller hangs up or another event interrupts the call).
Allowed values: integer >= 0
Defaults to 1.
Nesting rules
Play takes no child elements. Its text content must be a single fully qualified HTTPS URL pointing to an MP3 or WAV file. To play several files in sequence, use multiple Play elements.
Examples
Play an audio file once
Loop hold music indefinitely
Useloop="0" for hold music or waiting tones. The audio repeats until the caller hangs up or a parallel event (such as a bridged Dial connecting) moves the flow forward.
Play several files in order
Edge cases and tips
- URL must be reachable over HTTPS. If Vobiz cannot fetch the file (404, timeout, SSL error, or non-audio content type), it skips the element and continues to the next one. Always serve audio with a correct
Content-Type(audio/mpegfor MP3,audio/wavfor WAV). - Optimize for telephony. Use 8 kHz mono files. Higher sample rates increase fetch latency without improving call audio quality.
PlayvsSpeak. UsePlayfor prerecorded audio (consistent quality, music, jingles). UseSpeakfor dynamic text that changes per call.- Interrupting playback. To let the caller interrupt audio with a key press, nest
Playinside aGatherinstead of using it standalone.