Page 1 of 1

How to specify file source in audio tag

Posted: Tue Jun 05, 2018 8:07 pm
by rgstephens
I need to specify the source location for a pre-recorded audio file, but without using an http URL.
I tried variations of this:
<audio src="file://servername/c:/path/myfile.wav">Default text to speech</audio>
and also using a simple relative path:
<audio src="myfile.wav">Default text to speech</audio>
where in the second case the audio file is in the same location as the vxml file that is referencing it.
But I have been unable to get it to work. It always fails to find the pre-recorded audio and uses the default text.
Are any special access permissions needed or is there something else needed to use a non-http URI for the audio file location?

Re: How to specify file source in audio tag

Posted: Wed Jun 06, 2018 9:50 am
by support
Hi,

Unfortunately because of the architecture of VoiceXML, it is not possible to reference audio files that are not hosted on a web server. For Plum DEV, your VoiceXML code needs to be hosted either on a web server or in one of our hosted options (e.g. File Repository). That VoiceXML code then can use relative references to the audio files that are stored relative to that code. It is also possible to upload your audio to the File Repository and then use an absolute reference in your VoiceXML to the file that was uploaded. The audio repository provides an icon with the full link to each file that you can copy and paste into your code.

Regards,
Plum Support

Re: How to specify file source in audio tag

Posted: Wed Jun 06, 2018 12:51 pm
by rgstephens
If we were to go with the file repository route, can you add sub-folders into the repository? We have two versions of each audio file, english and spanish. Or would we be required to rename the files with a language indicator to make them unique?

Re: How to specify file source in audio tag

Posted: Wed Jun 06, 2018 1:11 pm
by support
Hi,

Yes, you can add sub-folders in your File Repository. You can refer to this documentation for using File Repository:

http://www.plumvoice.com/docs/dev/plumdevguide:filerepo

Regards,
Plum Support.