<record>
<record>
The <record>
element is an input item that collects a recording from the user. A reference to the recorded audio is stored in the input item variable, which can be played back (using the expr attribute on <value>) or submitted to a server to be saved/processed.
Attributes
Name | Data type | Description |
---|---|---|
name | String | The input item variable that will hold the recording. This is also the name that will be associated with the uploaded recording if it is submitted to a server. |
cond | String | (defaults to true) An expression that must evaluate to true after conversion to Boolean in order for the form item to be visited. |
expr | String | The initial value of the form item variable; default is ECMAScript undefined. If initialized to a value, then the form item will not be visited unless the form item variable is cleared. |
type | String | The media format of the resulting recording. Defaults to “audio/basic”. Can be set to “audio/x-alaw-basic” and “audio/x-wav”. |
beep | Boolean | (defaults to false) If true, a tone is emitted just prior to recording. |
maxtime | String | (defaults to 60 seconds) The maximum duration to record. The maximum record time is 1 hour. |
modal | Boolean | (defaults to true) If set to "false", all active DTMF grammars are turned on while recording. If the recording is terminated by DTMF and has a match with an active grammar, then the appropiate filled action is taken. If set to true, then any DTMF input is stored in the shadow variable |
finalsilence | String | (defaults to 3 seconds) The interval of silence that indicates end of speech. The maximum |
dtmfterm | Boolean | (defaults to true) If set to false, the input is ignored. If set to true, input immediately interrupts the recoding, and the |
Notes
The current VoiceXML 2.0 Last Call specification is unclear as to the proper handling of DTMF keypresses that terminate a recording. Until further clarification is available, Plum DEV will handle terminating DTMF by writing the keypress into the shadow variable name$.termchar. Other shadow variables available for <record>
are name$.duration, name$.size, and name$.maxtime. The name$.utterance, and name$.confidence shadow variables are not supported.
Example
The output of the above script would be:
Computer: Please record a message after the beep. *BEEP* Human: My dog has fleas. Computer: You just recorded the following message: Computer: (Plays back the recording) “My dog has fleas.”
Child Tags
<audio>, <catch>, <enumerate>, <error>, <filled>, <grammar>, <help>, <noinput>, <nomatch>, <prompt>, <property>, <value>
Parent Tags
Last updated