The <Play/> Element
This element plays an audio file back to the caller. Basix allows playback from a relative path inside your Basix storage folder (it must be in wav format).
Element Attributes
| Attribute name |
Description |
Allowed Values |
Default Value |
| loop |
number of times the file should be played |
integer between 1 and 5 |
1 |
| terminators |
digits that will terminate (interrupt) audio output |
0123456789*# |
|
| purpose |
indicates what this is used for. This is only relevant when this element is inside GetDigits or GetInput (elements with purpose="prompt" are used to compose the GetDigits/GetInput prompt. Elements with purpose="alert" are used to compose the 'input error' prompt |
'prompt' or 'alert' |
'prompt' |
- if the file to be played doesn't exist, call will terminate and error will be notified as Error="Cannot execute Play. File {{FILE}} doesn't exist"
Examples
Example 1: Simple Play
This XML document tells Basix to play file hello.wav from your domain storage.
1
2
3
|
<IVR>
<Play>ivr/hello.wav</Play>
</IVR>
|
1
2
3
4
5
6
7
|
<IVR>
<GetDigits numDigits="1" validDigits="12345">
<Speak voice="en-US-Standard-C">Hi. Please input your section number</Speak>
</GetDigits>
<Play>ivr/section{{Digits}}/greeting.wav</Play>
<Transfer>section{{Digits}}</Transfer>
</IVR>
|
Example 3: Resolving file dynamically from JSON data
1
2
3
4
5
|
<IVR>
<GetJSON var="data" url="https://somewhere.com/check"/>
<Play>{{data.greeting_audio_file}}</Play>
<Transfer>{{data.destination}}</Transfer>
</IVR>
|