"audio" Element
<audio>
Description
The audio element supports the insertion of recorded audio files in conjunction with synthesized speech. The audio element may be empty. If the audio element is not empty then the contents should be marked-up text to be spoken if the specified audio document is not available.
The result of this will be either; the referenced audio file is played, or the alternate text (if any is specified) will be rendered.
Syntax
<audio src = “src” > child elements </audio> |
Attributes
Attribute | Description |
src | Points to the location of the audio file. mandatory field |
Parent
<audio>, <emphasis>, <p>, <prosody>, <s>, <speak>, <voice>
Children
<audio>, <break>, <desc>, <emphasis>, <mark>, <p>, <phoneme>, <prosody>, <say-as>, <sub>, <s>, <voice>
Limitations/Restrictions
The value of the src attribute may refer to a local filepath(e.g. "file://c/audio/prompt.wav") or a remote HTTP location (e.g."http:// www.lumenvox.com /audio/prompt.wav").
The audio file format should be 16-bit 16 KHz PCM format only. This will be internally converted as needed to the target format.
If the referenced audio file cannot be accessed, the alternate child content will be rendered. If the referenced audio can be accessed, it will be played, and the alternate text will not be used.
The value of src is affected by the value of <speak>element xml:base attribute.
If the value of <speak> element xml:base attribute is“file://c/audio” and the value of <audio> element src is “test.pcm” themodified audio file will be found in “file://c/audio/test.pcm”.
In order for the value of src to not be affected by the value of <speak> element xml:base, you should use an absolute URL -- e.g. "http://remote-host/path/to/audio.wav" or "file://path/to/audio.wav"
If <speak> element xml:base attribute value is“file://c/audio” and <audio> element src is “@file://c/audio2/test.pcm”, the referenced audio file will be found in “file://c/audio2/test.pcm”.
Example
<?xml version="1.0"?> <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd" xml:lang="en-US" xml:base=”https://www.lumenvox.com/audio/”> <!-- Empty element --> Please say your name after the tone. <audio src="beep.wav"/> <!-- Container element with alternative text --> <audio src="prompt.pcm">What city do you want to fly from?</audio> <audio src="welcome.wav"> <emphasis>Welcome</emphasis> to the Voice Portal. </audio> </speak> |