# <prompt>

Description

Plays TTS to the user.

Note that prompts containing Speech Markup (SSML) will be passed into the TTS engine as an XML document. When the VoiceXML page is first parsed by the interpreter, the prompts will be decoded. The interpreter will then re-encode the prompt content into an XML document to pass to the TTS engine.

Syntax

    <prompt
        bargein="true" | "false" | "dtmf"
        bargeintype="energy" | "speech" | "hotword" | "recognition"
        cond="ECMAScript_Expression"
        count="integer"
        timeout="time_interval"
        xml:lang="language"
        xml:base="URI"
        ttsengine="string"
        broadcast="boolean">
      child elements
    </prompt>

Attributes

Attribute | Description
bargein | Controls whether or not user input can be collected before the prompt has finished playing. Optional. (Defaults to true.) true - Any user input can barge in during the current prompt. false - No user input can barge in during the current prompt. dtmf - Only DTMF input can barge in during the current prompt; speech input is ignored until the completion of the prompt; both speech and DTMF input can be collected after the completion of the prompt. Overrides the value of the `bargein` property.
bargeintype | The bargein type. Optional. (Defaults to speech.) energy - Any noise can barge in on the prompt. speech - Any user utterance can barge in on the prompt. hotword (equivalent to recognition) - Only user input that matches a grammar can barge in on the prompt. recognition - Only user input that matches a grammar can barge in on the prompt. Overrides the value of the `bargeintype` property.
cond | An ECMAScript expression to be evaluated and used as a boolean condition. This `<prompt>` will only be played if the expression evaluates to `true`. Optional. (Defaults to true.)
count | Each field item maintains a counter of number of times the item has been visited. The `count` attribute allows the application to play different prompts based on the counter. The prompt will be played when the counter reaches the `count` attribute. Optional. (Defaults to 1.)
timeout | The length of time to wait, if no speech occurs, before throwing a `noinput` event. Overrides the value of the `timeout` property. Optional. (Defaults to 10s.)
xml:lang | The language identifier of the prompt. If omitted, it defaults to the value specified in the document's `xml:lang` attribute. Optional. The list of supported values for this attribute depends on the TTS engine being used. Note that the `TTSENGINE` property must always be used to specify the TTS language. With some vendors, the `xml:lang` is only required additionally when prompts contain SSML; with others vendors, the `xml:lang` must always match the TTS engine language. Refer to your vendor documentation for support details.
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. Optional. (Not currently supported; will be ignored if defined.)
ttsengine | Specifies the name of the TTS (Text-to-Speech) engine to use (i.e. the voice) when playing this prompt. Overrides the value of the `ttsengine` property. Optional. The `ttsengine` attribute can also be used to enable RTSP streaming.
broadcast | Optional.

Parents

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

Children

<audio>, <enumerate>, <foreach>, <mark>, <value>, Speech Markup (SSML), #PCDATA

Extensions

- Added "dtmf" as value for `bargein` attribute.
- Added "energy" and "recognition" as values for `bargeintype` attribute.
- Added `ttsengine` attribute.
- Added `broadcast` attribute.

Limitations/Restrictions

- The `xml:base` attribute is not currently supported, and will be ignored if defined.
- `<prompt>` cannot be used as a child of `<foreach>` when `<foreach>` is a child of `<prompt>`.
- With the `com.voicegenie.STRICTCONFORMANCE` property set to `FALSE`), the platform has the following behaviour:

- When the actual time elapsed during a timeout is measured (ex. by using JavaScript in the page), it may be slightly shorter than the specified `timeout`.
- The `timeout`s of empty or invalid prompts (i.e. ones that don't contain any child elements or text) are ignored.
- Within a given input item, a prompt with `bargein="true"` will cause bargein to remain enabled for all the remaining queued prompts.

Example

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <form>
        <block>
          <prompt> Hello, world! </prompt>
        </block>
      </form>
    </vxml>