Plays the media file at the specified location.
<audio
src = "URI"
expr = "CDATA"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
offset = "CDATA"
offsetexpr = "CDATA"
type = "CDATA"
/>
Attribute |
Data Type |
Required? |
Default |
Description |
expr |
CDATA |
no |
NA |
ECMAScript expression that evaluates to the URI of the media file. Programmable Media Platform proprietary. Use the v_ovl_def parameter following the media file to specify:
|
fetchhint |
{prefetch | safe} |
no |
NA |
Specifies when the VoiceXML Interpreter context should retrieve content from the server. Valid values:
|
fetchtimeout |
CDATA |
no |
NA |
Interval to wait for the content to be returned before throwing an error.badfetch event. Use s for seconds (for example, 1s) and ms for milliseconds (for example, 1ms). |
maxage |
CDATA |
no |
NA |
Maximum acceptable age, in seconds, of a resource being fetched from the cache. Setting maxage to 0 means that a cached version is never considered fresh. If no maxage or maxstale values are set, the VoiceXML Interpreter:
|
maxstale |
CDATA |
no |
NA |
Maximum acceptable staleness, in seconds, of the resource being fetched, if the fetched resource is cached and expired. |
offset |
CDATA |
no |
NA |
Programmable Media Platform proprietary. The offset (in s or ms) at which to play the media file. This attribute is supported for:
The behavior of the offset attribute for HTTP or local files that reference a 3GP video file differs, depending on the presence of a sync point table and a matching I-frame. For information, see Details. Note: The offset attribute is not supported for live RTSP presentations. |
offsetexpr |
CDATA |
no |
NA |
An ECMAScript expression that evaluates to the offset. This can be used in conjunction with the lastresult$.bargeintime variable to let the application play a media file from the point at which the user barged in, and not have to restart the media file. This is especially useful for long media files. |
src |
URI |
no |
NA |
URI of the media file. Use the v_ovl_def parameter following the media file to specify:
|
type |
CDATA |
no |
NA |
Preferred media type of the requested resource. This can differ from the actual media type of the resource. The VoiceXML Interpreter currently ignores this attribute, determining the media type during HTTP content negotiation or content introspection. |
The <audio> element can contain child content (alternate content) that is played if the media file specified by the src or expr attributes is either not found or cannot be played. The <audio> element can reference an HTTP, file, builtin, or RTSP URI in its src attribute. For example:
http://video.example.com/intro.3gp
file://c:/audio/beep.wav
builtin:audio/nomatch
rtsp://stream.example.com:554/live.sdp
Valid source file types are:
3GP (.3gp)
Raw/headerless (.raw)
RIFF (.wav)
Sphere (.wav)
Sun audio (.au)
The offset attribute works as follows for HTTP or local files that reference 3GP video files:
If the Referenced 3GP Video File... |
And... |
Then the VoiceXML Interpreter... |
Contains a sync point table. |
There is an I-frame that corresponds to the specified offset. |
Plays the file from that I-frame. |
|
The specified offset does not match an I-frame. |
Plays the file from the next I-frame after the specified offset. |
|
There is no next I-frame. |
Does not play the file. |
Does not contain a sync point table. |
NA |
Ignores the offset attribute and plays the file from the beginning. |
<audio>, <block>, <catch>, <choice>, <enumerate>, <error>, <field>, <filled>, <foreach>, <help>, <if>, <initial>, <media>, <menu>, <noinput>, <nomatch>, <object>, <prompt>, <record>, <subdialog>, <transfer>
<audio>, <break>, <desc>, <emphasis>, <enumerate>, <mark>, <media>, <p>, <phoneme>, <prompt>, <prosody>, <s>, <say-as>, <sub>, <value>, <voice>
The following example plays a .wav file:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<audio src="../audio/test.wav" maxage="0"/>
</prompt>
<prompt>
<audio src="http://www.webserver.com/doesNotExist.wav"
fetchtimeout="1s">
Audio does not exist
</audio>
</prompt>
</block>
</form>
</vxml>
The following example plays a .3gp file:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<audio src="../video/test.3gp" maxage="0"/>
</prompt>
<prompt>
<audio src="http://www.vision.com/doesNotExist.3gp"
fetchtimeout="1s">
</audio>
</prompt>
</block>
</form>
</vxml>
The following example plays an RTSP video stream using an offset.
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<property name="inputmodes" value="dtmf"/>
<var name="nAbsOffsetMS" expr="0"/>
<form>
<field name="VCRControl" type="digits?length=1">
<prompt>
<audio src="rtsp://www.example.org:554/3gp/myfile.3gp"
offsetexpr="nAbsOffsetMS + 'ms'"/>
</prompt>
<filled>
<script>
// Determine the new offset based in the input
var nRelOffsetMS = 0;
nRelOffsetMS = (0 == VCRControl) ? -10000 : 10000;
nAbsOffsetMS = nAbsOffsetMS + lastresult$.bargeintime + nRelOffsetMS;
if (nAbsOffsetMS < 0) nAbsOffsetMS = 0;
</script>
<clear/>
</filled>
</field>
</form>
</vxml>