Description
Plays an audio file.
If the file cannot be played, the content of the <audio> element is played instead.
Any content must be prompt markup, including text, speech markup, and/or
other audio tags.
If the file cannot be found and played and there's no alternate content, the <audio> element is ignored.
Syntax
<audio
src="URI"
expr="ECMAScript_Expression"
fetchhint="prefetch" | "safe" | "stream"
fetchtimeout="time_interval"
maxage="integer"
maxstale="integer"
volume="integer from -9 to +9"
offsetexpr="ECMAScript_Expression"
lengthexpr="ECMAScript_Expression">
child elements
</audio> |
Attributes
|
Attribute |
Description |
|
src |
The URI specifying the location of the audio file. The URI can be one of the following formats:
Optional. Exactly one of src or expr must be specified. |
|
expr |
An ECMAScript expression to be evaluated and used as the URI
of the audio file, as
documented under Optional. Exactly one of src or expr must be specified. |
|
fetchhint |
Defines when the audio file should be fetched. Optional.
|
|
fetchtimeout |
The length of time to wait for the audio file to be fetched before playing the alternate content. If alternate content is not specified or cannot be found, the behaviour will be as specified in the element description, above. Optional. |
|
maxage |
Indicates that this document is willing to use a cached copy of this audio file only while the age of the cached copy is less than or equal to the number of seconds specified by this attribute. Optional. |
|
maxstale |
Indicates that this document is willing to use a cached copy of this audio file that has exceeded its expiration time by as much as the number of seconds specified by this attribute. Optional. |
|
volume |
Increases or decreases the volume of the audio file by the number of dB. Specified as +dB or -dB: eg. "+2". Optional. |
|
offsetexpr |
An ECMAScript expression to be evaluated and used as the time offset at which to begin playing the audio file. Optional. (Defaults to 0.) |
|
lengthexpr |
An ECMAScript expression to be evaluated and used as the time length of the audio data to be played from the file. Optional. (Defaults to the length of referenced audio.) |
Attribute Notes
src and expr will result in an
error.badfetch event being thrown.
If the com.voicegenie.STRICTCONFORMANCE property is set
to FALSE, the value of src overrides
expr if both are used.
Parents
<audio>, <block>, <catch>, <choice>, <enumerate>, <error>, <field>, <filled>, <foreach>, <help>, <if>, <initial>, <menu>, <noinput>, <nomatch>, <object>, <prompt>, <record>, <subdialog>, <transfer>, Speech Markup (SSML)
Children
<audio>, <enumerate>, <value>, Speech Markup (SSML), #PCDATA
extensions
fetchhint attribute.volume attribute.offsetexpr attribute.lengthexpr attribute.Limitations/Restrictions
<desc> and <mark> are not supported
within SSML content in <audio>. fetchhint is set to stream, the offsetexpr
and lengthexpr will be ignored.fetchhint is set to stream, the audio control
features will not work.fetchhint is set to stream, the entire prompt
queue will block and not play until all the HTTP fetches have started for
all the external audio files. Example
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
Here is the recorded thank you message:
<audio src="thankyou.vox">
If you can hear this, thankyou.vox was not found.
</audio>
</block>
</form>
</vxml> |