Tropo Scripting Development Guide Home  |  Frameset Home


record()  method


Plays a prompt (audio file or text to speech) and optionally waits for a response from the caller that is recorded. If collected, responses may be in the form of DTMF or speech recognition using a simple grammar format defined below. The record funtion is really an alias of the prompt function, but one which forces the record option to true regardless of how it is (or is not) initially set. At the conclusion of the recording, the audio file may be automatically sent to an external server via FTP or an HTTP POST/Multipart Form. If specified, the audio file may also be transcribed and the text returned to you via an email address or HTTP POST/Multipart Form.


usage

record( , {bargein: true | false,
    beep: true | false,
    choiceConfidence: float,
    choiceMode: string - dtmf | speech | any ,
    choices: string,
    format: String,
    maxTime: integer,
    recordPassword: string,
    recordURI: string - URI,
    recordUser: string,
    repeat: integer,
    silenceTimeout: float,
    timeout: float,
    transcriptionID: string,
    transcriptionOutURI: String } )


parameters

none


map parameters

bargein Data Type: true | false Default: true Optional
allows the user to interrupt the prompt with a response.
beep Data Type: true | false Default: false Optional
plays a beep before response entry or recording begins.
choiceConfidence Data Type: float Default: 0.3 Optional
A grammar-based list of choices the user may make. Response grammars can be defined in Simple Grammar, GRXML or JSGF formats.
choiceMode Data Type: string - dtmf | speech | any Default: any Optional
dtmf, speech or any
choices Data Type: string Default: none Optional
a list of choices the user may make, defined in Simple Grammar, GRXML or JSGF formats.
format Data Type: String Default: "" (undefined) Optional
The format to record in. This may be 'audio/wav' or 'audio/mp3'.
maxTime Data Type: integer Default: 30 Optional
maximum amount of time in ??? Tropo will wait for a response from the user.
recordPassword Data Type: string Default: none Optional
If using FTP -- the FTP account password
recordURI Data Type: string - URI Default: none Optional
FTP or HTTP URL to post the recorded audio file to
recordUser Data Type: string Default: none Optional
If recording to FTP -- FTP account username
repeat Data Type: integer Default: 0 Optional
Number of times Tropo should repeat the prompt and attempt to get a response from the user.
silenceTimeout Data Type: float Default: 5.0 Optional
The amount of time after the caller is done speaking before the users response is considered done. Applies only to voice input.
timeout Data Type: float Default: 5.0 Optional
The amount of time Tropo will wait--after sending or playing the prompt--for the user to begin a response.
transcriptionID Data Type: string Default: none Optional
User definable ID that can be included when the transcription is posted to transcriptionOutURI
transcriptionOutURI Data Type: String Default: "" (undefined) Optional
email address or HTTP URL to send the transcription results to



events

onBadChoice   onChoice   onError   onEvent   onHangup   onRecord   onSilenceTimeout   onTimeout


return values

event


code samples

Javascript example - recording audio input
answer();
// Record a message.  Play the beep, caller must speak within 10 seconds.  
// Allow 7 seconds of silence and up to 60 seconds of recording.
result=record( "Hello.  Thanks for calling.  Leave your message at the beep.",
                { beep:true, timeout:10, silenceTimeout:7, maxTime:60 }         );
if ( result.name=='record') 
{ 
    // record returns a URI pointing to the recorded audio...
    log( "result.recordURI = " + result.recordURI );
    // we can then use that URI in a say command to play the recorded audio back...
    say( "you said " + result.recordURI );
}
hangup();



additional links

none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2010 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site