Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update record-simpleexample.js #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions javascript/record-simpleexample.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
// Simple example of recording
// --------------------------------------------

event=record("Leave your message at the beep. Thanks!",
record("Leave your message after the beep. Thanks!",
{
beep:true, silenceTimeout: 5, maxTime:60, timeout:10,
onRecord:function(event )
{ say("you said " + event.recordURI ) }
onRecord:function(event)
{
// Note that by default, Tropo stores the recorded audio file on its runtime server.
// This temporary file cannot be accessed externall: only your script will be able to read the audio file as it gets executed inside tropo hosting environment.
//
// If you want to keep the audio file in a safe place, use the recordURI parameter.
// - to specify your Tropo files directory, specify recordURI:"ftp://ftp.tropo.com" and your user/password,
// - or simply push the file to any external service: recordURI:"https;//..." or "ftp://..."
//
// for more info, check: https://www.tropo.com/docs/hosting-debugging-logs/audio
say("you said " + event.value );
}
} );

log( "event.recordURI = " + event.recordURI );