Last reviewed: 3/23/2024 12:32:23 PM

<prompt>

A <prompt> element queues speech synthesis and audio output to the user.

Syntax

<prompt bargein="boolean"
        bargeintype="bargeintype"
        cond="expression"
        count="integer"
        timeout="secondsormilliseconds"
        xml:base="uri"
        xml:lang="langid" />

Attributes

bargein

Control whether a user can interrupt a prompt. The default value is the value of the bargein property.

bargeintype

The type of bargein. The default value is the value of the bargeintype property.

Bargein Type Description
hotword The prompt will not be stopped until a complete match of an active grammar is detected. Input that does not match a grammar is ignored (note that this even applies during the timeout period); as a consequence, a nomatch event will never be generated in the case of hotword bargein.
speech The prompt will be stopped as soon as speech or DTMF input is detected. The prompt is stopped irrespective of whether or not the input matches a grammar and irrespective of which grammars are active.

cond

An expression that must evaluate to true after conversion to boolean in order for the prompt to be played. Default is true.

count

A number that allows you to emit different prompts if the user is doing something repeatedly. The default value is 1.

timeout

The timeout that will be used for the following user input. The value is a Time Designation. The default noinput timeout is platform specific.

xml:base

Declares the base URI from which relative URIs in the prompt are resolved. This base declaration has precedence over the <vxml> base URI declaration. If a local declaration is omitted, the value is inherited down the document hierarchy.

xml:lang

The language identifier for the prompt. The default value is the value specified in the document's xml:lang attribute.

Children

<assign>, <audio>, <clear>, <disconnect>, <enumerate>, <exit>, <goto>, <if>, <log>, <prompt>, <reprompt>, <script>, <submit>, <throw>, <value>, and <var>.

Parents

<block>, <catch>, <error>, <field>, <filled>, <help>, <if>, <initial>, <menu>, <noinput>, <nomatch>, <object>, <prompt>, <record>, <subdialog>, and <transfer>.

Variables

none

Example

The following example illustrates using example elements.

<field name="state">
  <prompt>What state?</prompt>
  <grammar src="state.grxml"  type="application/srgs+xml"/>
  <catch event="help">
     Please speak the state for which you want the weather.
  </catch>
 </field>

Version Information

Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.