A Tutorial Introduction to SALT

5. The <PROMPT> element

A SALT <prompt> element creates an object that can produce speech and audio output to the user. We can script control of the object to specify what speech is produced and when it should start. The object can also detect that someone has started speaking while it is producing output. We can also control fine detail of the spoken text using a synthetic speech mark-up language. We give a basic introduction to the <prompt> element below, but for a more complete description refer to the SALT specification or the SASDK documentation.

5.1 XML structure

The essential XML structure of a <prompt> object is as follows:

    <prompt attributes>
       <param attributes />    // Speech system configuration
       prompt text
       <content attributes />  // Call on another resource
       prompt text
       <value attributes />    // Get text from another object
    </prompt>
    

The <param>, <content> and <value> sub-elements are optional. Also the prompt text may be empty.

5.2 Attributes

The attributes of the <prompt> element are as follows:

Attribute Description
id=name Provides a unique object name for the prompt object.
bargein=true/false (Optional) If true, means that output stops if user starts speaking over prompt.
xml:lang=en-US (Optional) Sets output language.
xmlns=namespace (Optional) Sets namespace of markup used to control synthetic speech. Typically this refers to "http://www.w3.org/2001/10/synthesis" which identifies the Synthetic Speech Markup Language (SSML).
onbargein=func() (Optional) Causes script function func() to be called if a bargein event occurs.
oncomplete=func() (Optional) Causes script function func() to be called when replay completes.
onerror=func() (Optional) Causes script function func() to be called if a replay error occurs.

5.3 Properties

A prompt object has no interesting properties.

5.4 Methods

A prompt object has the following methods that may be called from a script function.

Method Description
Start(prompt text) Starts replay of the prompt text supplied.
Start() Starts replay of the prompt text contained in the <prompt> markup.

5.5 The prompt <content> element

The <content> sub-element can be used to include in the output some text or some audio that is obtained from some external source. It has the following attributes:

Attribute Description
href=URI Identifies location of external content (typically text or audio).
type=media−type Specifies the media type of the external content. For plain text use "text/plain", for SSML use "application/ssml+xml", for audio use "audio/wav".

Here is an example of the use of the <content> element:

    <prompt>
      <content href="/VoiceMailWelcome.ssml" type="application/ssml+xml" />
      After the beep, please record your message:
      <content href="/wav/beep.wav" />.
    </prompt>
    

5.6 The prompt <value> element

The <value> sub-element can be used to include in the output some text that has been obtained from some other object in the web page. It has the following attributes:

Attribute Description
targetelement=object Identifies document object from which to get text.
targetattribute=property Specifies the name of the object property from which to retrieve the text. Default: "value".

Here is an example of the use of the <value> element:

    <salt:prompt id="Prompt1">
      You are traveling from
      <salt:value targetelement="fromCity"  targetattribute="value"/>
      to
      <salt:value targetelement="toCity"  targetattribute="value"/>
    </salt:prompt>
    

Next: speech synthesis mark-up language.

A Tutorial Introduction to SALT © 2005 Mark Huckvale, Phonetics and Linguistics, University College London

University College London - Gower Street - London - WC1E 6BT - Telephone: +44 (0)20 7679 2000 - Copyright © 1999-2013 UCL