Plays an audio clip to the user.
<audio
src="URI"
expr="js_expression"
fetchhint="prefetch"|"safe"
fetchtimeout="time_interval"
maxage="time_interval"
maxstale="time_interval" >
bevocal:ssml="URI" >
bevocal:ssmlexpr="js_expression"
>
Optional Content
</audio>
The audio clip is played in its entirety unless interrupted.
The Audio Library contains stored audio files with commonly used spoken prompts and other sounds that you can use in your applications.
If the bargein property is true, a user utterance can interrupt playing of the audio clip. If the bargeintype property is recognition, only an utterance that matches an active grammar can interrupt the audio clip. In the latter case, the bevocal.hotwordmin and bevocal.hotwordmax properties specify the minimum and maximum time duration, respectively, of the interrupting utterance.
| Attribute | Description |
src |
The URI of the audio file. Optional (as alternative to If not specified or invalid (that is, the interpreter was unable to perform the fetch from the specified URI), any content of the |
expr |
New in VoiceXML 2.0. JavaScript expression that evaluates to either a string or an array or strings, or can be the recorded audio from the input variable of a If the expression evaluates to JavaScript Extension. If it is an array, each element is treated as an audio file URI, each of which is fetched and played, in turn. |
fetchhint |
Specifies whether the interpreter can attempt to optimize dialog interpretation by prefetching the resource. See Prefetching Resources. Optional. Note: The interpreter can prefetch an audio file specified by the |
fetchtimeout |
Specifies the interval to wait for the resource to be returned before throwing a |
maxage |
New in VoiceXML 2.0. Specifies the maximum acceptable age, in seconds, of the cached resource. See Maximum Age. Optional. |
maxstale |
New in VoiceXML 2.0. Specifies the maximum acceptable time, in seconds, during which an expired cached resource can still be used. See Maximum Stale Time. Optional. |
bevocal:ssml |
Extension. A URI which refers to an SSML document. This SSML document should be compliant to the W3C SSML spec but may have certain extensions. See Chapter 9, Dynamic SSML for details. Optional (as alternative to |
bevocal:ssmlexpr |
Extension. A JavaScript expression which resolves to the URI expected by the |
(VoiceXML 1.0 only) The following attributes can be used in applications in which the version attribute of the <vxml> tag is set to 1.0.
| Attribute | Description |
caching |
VoiceXML 1.0 only. Specifies the caching policy for the resource being fetched. See Caching. Optional. Used in place of the VoiceXML 2.0 attributes |
For playing prompts, the BeVocal interpreter supports popular formats including Wave (.wav), Sun audio (.au) and MP3. Because we use JMF technology, you can refer to the following reference for a complete list of audio formats supported: http://java.sun.com/products/java-media/jmf/2.1.1/formats.html.
Note: If the specified audio file is an unsupported type, any alternative audio content of the <audio> element (text, prompts, and so on) is played instead.
|
|||
|
|||
|
|||
|
|||
function female1(a) { return("audio/female1/en_us/" + a); } function common(b) { return(female1("common/" + b + ".wav")); } function number(b) { return(female1("number/" + b + ".wav")); } |
|||
<audio expr="common('bevocal_chimes')"/> |
|||
|
| | VoiceXML 2.0 Specification: <audio> |
<?xml version="1.0" ?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
"http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="foo">
<block>
<prompt>
Welcome to BeVocal Cafe, the number One place to
build and deploy your voice applications.
</prompt>
<audio maxage="0"
src="http://cafe.bevocal.com/libraries/audio/female1/en_us/common/bevocal_cafe
.wav"/>
</block>
</form>
</vxml>
<?xml version="1.0" ?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
"http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<!-- Define functions; one returns a string;
many returns an array of strings -->
<script>
<![CDATA[
var base =
"http://cafe.bevocal.com/libraries/audio/female1/en_us/number/";
function one() {
return base + "6000-e.wav";
}
function many() {
var result = new Array(4);
result[0] = base + "6000-b.wav";
result[1] = base + "300.wav";
result[2] = base + "37_and.wav";
result[3] = base + "1-32.wav";
return result;
}
]]>
</script>
<form>
<block>
<prompt>
Playing result of one
<audio expr="one()">one</audio>
<break/>
Playing result of many
<audio expr="many()">many</audio>
</prompt>
</block>
</form>
</vxml>
| Café Home |
Developer Agreement |
Privacy Policy |
Site Map |
Terms & Conditions Part No. 520-0001-02 | © 1999-2005, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL |