Declares an input field in a form. Prompts user for values that match a grammar.
|
|
Attribute |
Description |
|
name |
The name of this field. This variable holds the matched user input and can be referenced anywhere within the field's form. Optional. (Defaults to an inaccessible internal variable.) |
|
expr |
An ECMAScript expression to be evaluated and used as the initial value of this field. This field will be visited only if the expression evaluates to |
|
cond |
An ECMAScript expression to be evaluated and used as a boolean condition. This field will be visited only if the expression evaluates to |
|
type |
Specifies a built-in speech and dtmf grammar for this field. Optional (an alternative to using speech and dtmf <grammar> elements to specify the built-in grammar). |
|
slot |
The name of the grammar slot used to populate the field item variable; usually used for mixed initiative dialogs. Optional. (Defaults to the field name.) |
|
modal |
Set to true if only the field's grammars are to be enabled. Otherwise, all active grammars are enabled. Optional. (Defaults to false.) |
|
recordutterance |
Set to true to enable recording of user utterances. Overrides the value of the recordutterance property. Platform Extension. Optional. (Defaults to false.) A platform extension. |
|
recordutterancetype |
Specifies the mime type of the recorded utterance, if recordutterance is enabled. Platform Extension. Optional. (Defaults to audio/basic.) A platform extension. |
|
utterancedest |
Specifies the path of the directory to use for saved utterance audio files. The value will be resolved relative to the Optional. A platform extension. |
|
endbeep |
Specifies whether or not a beep should be played at the end of the prompts. The beep is treated as any <audio> element. Platform owners can access the audio file at A platform extension. |
|
audioinexpr |
An ECMAScript expression which should evaluate to a string that specifies a recording to be used as speech input in this field. This can specify a complete or relative URI, or a variable reference to a recording (i.e. A platform extension. |
|
wakeupword |
Specifies whether or not Wakeup Word Spotting should be used for input in this field. Overrides the value of the A platform extension. |
error event may be thrown if a reserved ECMAScript word is used as the name.type attribute references an invalid builtin type, the error.unsupported.builtin event is thrown at runtime.For each <field> whose name attribute is set to <name>, there is a shadow variable <name>$ (in the same scope as the field name variable), containing the following properties:
|
Property |
Description |
|
<name>$.confidence |
The recognition confidence level. Floating point value between 0.0 and 1.0. |
|
<name>$.inputmode |
The user input mode. One of dtmf or voice. |
|
<name>$.interpretation |
The same value as |
|
<name>$.audiooffset |
(VoiceGenie extension) Offset of audio data on bargein (-1 if audio was played to the end). This is |
|
<name>$.bargein |
(VoiceGenie extension) True if bargein occurred, false otherwise. |
|
<name>$.recording |
(VoiceXML 2.1 feature) A reference to the recording, or |
|
<name>$.recordingsize |
(VoiceXML 2.1 feature) The size of the recording in bytes, or |
|
<name>$.recordingduration |
(VoiceXML 2.1 feature) The duration of the recording, or |
|
<name>$.markname |
(VoiceXML 2.1 feature) The name of the mark last executed by the SSML processor before barge-in occurred or the end of audio playback occurred. If no mark was executed, this variable is |
|
<name>$.marktime |
(VoiceXML 2.1 feature) The number of milliseconds that elapsed since the last mark was executed by the SSML processor, until barge-in occurred or the end of audio playback occurred. If no mark was executed, this variable is |
undefined.The following built-in types are supported:
|
Type |
Description |
|
boolean |
Grammar for affirmative and negative phrases. Returns true for "yes" (or DTMF equivalent) and false for "no" (or DTMF equivalent). |
|
currency |
Grammar for currency amount. The result is a string with the format UUUmm.nn, where UUU is the three character currency indicator according to ISO standard 4217:1995, or mm.nn if the currency is not spoken by the user or if the currency cannot be reliably determined (e.g. "dollar" and "peso" are ambiguous). If the field value is subsequently used in a prompt, it will be spoken as a currency amount appropriate to the current locale. The set of accepted spoken currency formats is platform dependent and may vary by locale. |
|
date |
Grammar for specifying a date. Returns a fixed-length date string format yyyymmdd. If the year is not specified, yyyy becomes ????; if the month is not specified, mm becomes ??; if the day is not specified, dd becomes ??. |
|
digits |
Grammar for a string of digits. Returns the string of digits. |
|
number |
Grammar for numbers. Returns a string of digits from 0 to 9, and may optionally include a decimal point (".") and/or a plus or minus sign. |
|
phone |
Grammar for a phone number. DTMF asterisk "*" represents "x". The result is a string containing a telephone number consisting of a string of digits and optionally containing the character "x" to indicate a phone number with an extension. For North America, a result could be "8005551234x789". |
|
time |
Grammar for specifying time. The result is a five character string in the format hhmmx, where x is one of "a" for AM, "p" for PM, "h" to indicate a time specified using 24 hour clock, or "?" to indicate an ambiguous time. Because there is no DTMF convention for specifying AM/PM, in the case of DTMF input, the result will always end with "h" or "?". |
The boolean and digits built-in types can be parameterized with the following syntax:
typename?parameter1=value1;parameter2=value2
For example, we can assign DTMF equivalents for "yes" and "no" in the boolean type:
<field name="mychoice" type="boolean?y=5;n=6">
|
Type |
Input Parameters |
|
boolean |
|
|
digits |
If there is a conflict among these parameters, an |
Audio Catch Enumerate Error Filled Grammar Help Link Noinput Nomatch Option Prompt Property Value #PCDATA
recordutterance and utterancedest attributes.endbeep attribute.audioinexpr attribute.wakeupword attribute.audiooffset, bargein and info shadow variables.
|