<audio>

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.  The <audio> element can be used similarly to play a video file.  If the file cannot be found/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:

  • External audio file: URL of the audio file
  • Local audio: builtin:[path/]filename
    (an audio file named /usr/local/phoneweb/audio/[path/]filename or C:\VoiceGenie\mp\audio\[path\]filename must exist on the VoiceGenie platform)

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 src, above; or an ECMAScript audio variable (such as the name associated with a previously filled <record>).  If a specified expr evaluates to null, the <audio> element will be skipped, including its alternate content.

Optional. Exactly one of src or expr must be specified.

fetchhint

Defines when the audio file should be fetched. Optional.

  • prefetch - audio file may be downloaded when the page is loaded (not currently supported)
  • safe - only load the audio file when needed

Overrides the value of the audiofetchhint property.

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.

Overrides the value of the fetchtimeout property.

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.

Overrides the value of the audiomaxage property.

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.

Overrides the value of the audiomaxstale property.

volume

Increases or decreases the volume of the audio file by the number of dB. Specified as +dB or -dB: eg. "+2". Optional.

A platform extension.

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)

A platform extension.

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.)

A platform extension.

Attribute Notes

Parents

Audio Catch Choice Enumerate Error Field Filled Foreach Help If Initial Menu Noinput Nomatch Object Prompt Record Subdialog Transfer Speech Markup (SSML) Tags

Children

Audio Enumerate Value Speech Markup (SSML) Tags

VoiceGenie Extensions

Limitations/Restrictions

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>