For a specific project, I am trying to write a voicexml file to play out some audio files. I have no problem about playing an file. But I need some directions for playing multiple files in a folder. I know I have to use ecmascript and tag to do this. But I can't figure out how to access a folder to play the specific wav files.
Here is my code to play 1 audio file:
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:base="file://">
<var name="repeat" expr="session.user.repeat"/>
<form id="loopblock">
<block>
<if cond="repeat > 0">
<prompt>
<audio src="file://provisioned/music.wav"/>
</prompt>
<assign name="repeat" expr="repeat - 1"/>
<goto next="#loopblock"/>
</if>
<disconnect/>
</block>
</form>
</vxml>
I have a folder which includes different .wav files.
- /provisioned/music/a.wav
- /provisioned/music/b.wav
- /provisioned/music/c.wav
How can I play all of them without calling them one by one because anyone can customize this wav file. All I need to scan the folder and play them out with VoiceXML.
I'd be appreciated for any suggestion.