<record>

Description

Collects a recording from the user.  A reference to the recorded audio is stored in the form item variable, which can be played back or submitted to a server.   The <record> element can be used similarly to record a video file (see types below).

Syntax

<record
    name="string"
    expr="ECMAScript_Expression"
    cond="ECMAScript_Expression"
    modal="boolean"
    beep="boolean"
    maxtime="time_interval"
    mintime="time_interval"
    timeout="time_interval"
    finalsilence="time_interval"
    dtmfterm="boolean"
    type="MIME_type"
    dest="URI"
    destexpr="ECMAScript_Expression">
  child elements
</record>
      

Attributes

Attribute

Description

name

The name of this recording. This variable holds the result of the record, and can be referenced anywhere within the record's form.

The result is actually the file location of the recorded audio on the VoiceGenie platform. When referenced as <audio expr="name"/>, the recorded audio will be played back. When referenced as <value expr="name"/>, the recording will also be played, but only in contexts where audio playback is possible. The recording variable can also be used to submit the audio data.  In other references (ex. in <value> within <log>; if modified by string functions in <value>; in <script>s, etc.), the name will be treated as a string, and will give the file location.

Optional. (Defaults to an inaccessible internal variable.)

expr

An ECMAScript expression to be evaluated and used as the initial value of this record.  This record will be visited only if the expression evaluates to undefined.  Optional. (Defaults to undefined.)

cond

An ECMAScript expression to be evaluated and used as a boolean condition.  This record will be visited only if the expression evaluates to true. Optional. (Defaults to true.)

modal

Set to true if only the record's (dtmf) grammars are enabled.  Otherwise, all active (dtmf) grammars are enabled. Optional. (Defaults to true.)

beep

Specifies whether or not a beep should be emitted just prior to recording.  Platform owners can access the audio file at /usr/local/phoneweb/audio/effects/endofprompt.vox or C:\VoiceGenie\mp\audio\effects\endofprompt.vox (the location is specified by the record.start.beep.filename parameter in the Call Manager configuration). Optional. (Defaults to false.)

maxtime

The maximum duration to record. Minimum value is 250ms (if defined as a shorter duration, it will be set to 250ms); maximum value is whatever the default is (if defined as a longer duration, it will be set to the default). Optional. (Defaults to 600000ms/10min or value of com.voicegenie.maxrecordtime property.)

mintime

If the duration of the recording is less than this attribute, then the recording is assumed to be empty and a noinput is thrown. Minimum value is 250ms (if defined as a shorter duration, it will be set to 250ms); maximum value is the value of the maxtime attribute (if defined as a longer duration, it will be set to 250ms).  Optional.  (Defaults to 250ms.)

timeout

The time to wait, if no speech occurs, before throwing a noinput event.  Minimum value is 0ms; maximum value is the value of the maxtime attribute.  Optional.  (Defaults to timeout of the last prompt if specified, otherwise the timeout property is used.)

A platform extension.

finalsilence

The interval of silence that indicates end of speech. Maximum value is the value of the maxtime attribute.  Optional. (Defaults to 4s.)

dtmfterm

Setting this to true is equivalent to defining a local DTMF grammar which matches any single DTMF key (to terminate recording). The DTMF tone will not be part of the recording. Optional. (Defaults to true.)

type

The media format of the resulting recording.  Optional.  (Defaults to audio/basic.).  See Type Chart, below.

dest

The destination of the recording.  Optional.

A platform extension.

destexpr

An ECMAScript expression to be evaluated and used as the destination of the recording.  Optional.

A platform extension.

Attribute Notes

Type Chart

The audio types in the following chart are also supported for full-call recording. (If you own a VoiceGenie platform, see the GenieSupport tutorial for details on the full-call recording feature.) However, note that versions 5.x and 6.x have a limitation that any full-call recording types containing a semi-colon (';'), such as audio/x-wav;codec=ulaw, will cause an error.

Supported Recording Formats

Type Recorded File Format/Sample Size/Encoding File Extension
audio/x-vox
audio/vox
audio/basic
  • Raw audio
  • 8-bit mono
  • u-law, a-law (depends on platform configuration)
.vox
audio/x-alaw-basic
  • Raw audio
  • 8-bit mono
  • a-law
.alaw
audio/x-g726-24
  • Raw audio
  • 24kbit/sec
  • ADPCM (g726)
.adpcm24
audio/x-g726
audio/x-adpcm
audio/adpcm
audio/x-adpcm8
  • Raw audio
  • 32kbit/sec
  • ADPCM (g726)
.adpcm
audio/x-g726-40
  • Raw audio
  • 40kbit/sec
  • ADPCM (g726)
.adpcm40
audio/L8
  • Raw audio
  • 8-bit unsigned mono
  • Linear PCM
.pcm8
audio/L16
  • Raw audio
  • 16-bit signed mono
  • Linear PCM
.pcm16
audio/x-wav
audio/wav
  • Audio with .wav header
  • 8-bit mono
  • u-law, a-law (depends on platform configuration)
.wav
audio/x-wav;codec=ulaw
audio/wav;codec=ulaw
  • Audio with .wav header
  • 8-bit mono
  • u-law
.wav
audio/x-wav;codec=alaw
audio/wav;codec=alaw
  • Audio with .wav header
  • 8-bit mono
  • a-law
.wav
audio/x-wav;codec=pcm
audio/wav;codec=pcm
  • Audio with .wav header
  • 8-bit unsigned mono
  • PCM
.wav
audio/x-wav;codec=pcm16
audio/wav;codec=pcm16
  • Audio with .wav header
  • 16-bit signed mono
  • PCM
.wav
audio/x-wav;codec=g726
audio/wav;codec=g726
  • Audio with .wav header
  • 32kbit/sec
  • ADPCM (g726)
.wav
audio/x-wav;codec=g726;rate=<rate>
audio/wav;codec=g726;rate=<rate>
  • Audio with .wav header
  • <rate> = 16, 24, 32, or 40kbps
  • ADPCM of corresponding <rate> (g726)
.wav
audio/x-gsm
(v6.0+)
  • Raw audio
  • gsm 6.10
.gsm
audio/x-g729
(v7.0+)
  • Raw audio
  • g729
.g729
video/h263
(v7.1+)
  • Raw video
  • h263
.263
video/avi[;codec=<audio_codec>;
rate=<g726_encoding_rate>;
videocodec=<video_codec>]
(v7.1+)
  • Audio/video stored in .avi container
  • Audio: u-law, a-law, PCM, ADPCM (depends on file header information)
  • Video: h263
.avi

Notes

  1. AU and NIST file recording are not currently supported.
  2. Only the 8000 Hz audio sampling rate is supported.
  3. Only g726 ADPCM audio files are supported. Currently, the platform supports 24, 32, and 40 kbit/sec. 16 kbit/sec g726 will be supported in the future.
  4. The above audio types are also supported for full-call recording. (If you own a VoiceGenie platform, see the GenieSupport tutorial for details on the full-call recording feature.)

Shadow Variables

For each <record> whose name attribute is set to <name>, there is a shadow variable <name>$ (in the same scope as the record name variable), containing the following properties:

Property

Description

name$.duration

The duration of the recording in milliseconds.

name$.size

The size of the recording in bytes.

name$.termchar

If the dtmfterm attribute is true, and the user terminates the recording by pressing a DTMF key, then this shadow variable is the key pressed (e.g. "#"). Otherwise it is ECMAScript undefined.

name$.maxtime

Set to true if the recording was terminated because the maxtime duration was reached. 

name$.dest

(VoiceGenie extension) The location of the recording.

name$.filetype

(VoiceGenie extension) The media format of the recorded audio file.

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 undefined.  This is only meaningful when the <record>'s prompts contain at least one <mark>.

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. This is only meaningful when the <record>'s prompts contain <mark>s.

Shadow Variable Notes

Parents

Form

Children

Audio Catch Error Filled Grammar Help Noinput Nomatch Prompt Property Value #PCDATA

VoiceGenie Extensions

Limitations/Restrictions

Example

<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
  <form>
    <record name="message" beep="true" maxtime="10s">
      <prompt>
        At the tone, please record your message.
      </prompt>
      <filled>
        You recorded <value expr="message"/>.
      </filled>
    </record>
  </form>
</vxml>