<prompt>

Queues TTS and audio output to the user.

Syntax

<prompt

 

      bargein="true"|"false"

 

      bargeintype="hotword"|"speech"

 

      cond="js_expression"

 

      count="integer"

 

      timeout="time_interval"

 

      xml:lang="language specifier"

 

>

 

   Prompt Text

 

</prompt>

 

Description

Uses TTS to convey information to the user. If the prompt consists of simple text only, you can omit the prompt tags and the text will be interpreted as if they were present.

The prompt is played in its entirety unless interrupted.

If the bargein property is true, a user utterance can interrupt the prompt. If the bargeintype property is hotword, only an utterance that matches an active grammar can interrupt the prompt. 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
bargein

Determines whether user input will be recognized during the prompt. Optional (if not specified, the current value of the bargein property is used).

bargeintype

New in VoiceXML 2.0. Determines what kind of input can interrupt the prompt. Optional (if not specified, the current value of the bargeintype property is used).

Possible values are:

 •  hotword--User input that doesn't match the grammar is ignored and only speech that matches a grammar can interrupt the prompt.
 •  speech--Any user utterance can interrupt the prompt.

This attribute is relevant only when bargein is true.

If the <prompt> occurs inside a bridge transfer, the value of this bargeintype attribute is ignored. For a bridge transfer, the bargein type is always hotword.

cond

JavaScript boolean expression that must evaluate to true for the prompt to be spoken.

count

Minimum number of times the user must have visited the form item containing the prompt for the prompt to be spoken. Optional (default is 1).

Lets you vary prompts if the user is having problems and revisits the same form item several times. Form item prompt counters are reset with each invocation of the form.

timeout

Time to wait before throwing a no-input event. Optional (if not specified, the current value of the timeout property is used).

Express time interval as an unsigned number followed by s for time in seconds; ms for time in milliseconds.

xml:lang

Language of TTS voice to use (see Specifying TTS Voices). Optional

TTS voices can be specified by setting the bevocal.voice.name property, or by using the name attribute of the <voice> tag. The same syntax is used for both.

See the <vxml> tag for a list of valid values for the xml:lang attribute.

If no matching TTS voice is found for the specified language, an error.unsupported.language event is thrown. If this attribute is not specified, the TTS voice for the xml:lang attribute from the <vxml> attribute is used.

Tip:

 •  If a JavaScript expression contains any of the characters "<", ">", or "&", that character must be replaced with the corresponding escape sequence "&lt;", "&gt;", or "&amp;". For more information, see JavaScript Quick Reference.

Usage

Parents Children
<bevocal:foreach>
<bevocal:listen>
<bevocal:register>
<bevocal:verify>
<block>
<catch>
<error>
<field>
<filled>
<help>
<if>
<initial>
<menu>
<noinput>
<nomatch>
<record>
<transfer>
<subdialog>

<audio>
<break>
<emphasis>
<enumerate>
<mark>
<p>
<paragraph>
<prosody>
<s>
<say-as>
<sentence>
<value>
<voice>

See Also

 •  VoiceXML 2.0 Specification: <prompt>
 •  Related tags: <reprompt>, <audio>, <transfer>

Examples

Example 1. Tapered prompts:

 <?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">
   <property name="universals" value="help" />
   <form id="tapered"> 
     <block> 
       <prompt bargein="false">
         This is question number 1.
       </prompt> 
     </block> 
     <field name="color"> 
       <noinput> <reprompt/> </noinput>
       <nomatch> <reprompt/> </nomatch>
       <grammar type="application/x-nuance-gsl">
         [blue red green yellow]
       </grammar> 
       <prompt count="1">What is the color of the Sky?</prompt> 
       <prompt count="2">Choose a color.</prompt>
       <prompt count="3">Choose from red blue green or yellow.</prompt> 
       <help>
         The color of the sky is usually blue except 
         during sunset and sunrise.
       </help>
       <filled>
         <if cond="color=='blue'">
           <prompt>Thats correct. The sky is <value expr="color"/> </prompt>
         <else/>
           <prompt> thats not correct. The sky is blue in color. </prompt>
         </if>
       </filled>
     </field> 
   </form> 
 </vxml>

Example 2:

 <?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="mynum"> 
     <var name="phone" expr="5555555555"/> 
     <field name="get_num" type="boolean">
       <prompt>
         My phone number is
         <say-as type="telephone"> <value expr="phone"/> </say-as>
         Do you want to tell me your number? 
       </prompt> 
       <filled>
         <if cond="get_num"> 
           <goto nextitem="your_num"/>
         <else/>
           <prompt> Ok, do not tell me. </prompt>
         </if>
       </filled> 
     </field> 
     <field name="your_num" type="phone" cond="get_num">
       <prompt>
         What is your phone number
       </prompt> 
       <filled>
         <prompt>
           So your number is
           <say-as type="telephone"> <value expr="your_num"/> </say-as>
         </prompt>
       </filled> 
     </field> 
   </form> 
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL