Many developers who are new to VoiceXML often post questions on the Plum support forum about how to dynamically fetch an audio file and use it to play a prompt in their IVR scripts.
To be able to pull the correct audio file, developers can program their applications to dynamically add the file into their vxml code. The following code builds an audio tag with a file source of ‘need_to_choose.wav’.
<submit next=”output.php” namelist=”list of necessary variables”/>
//Do all necessary actions to determine file name here:
$name = ‘need_to_choose’;
echo “<?xml version=”1.0″?>”;
<audio src=”<?= $name ?>.wav”/>
For more information and code samples please visit the Plum Support Forum.