Skip to content

Instantly share code, notes, and snippets.

@visionik
Created September 19, 2011 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save visionik/1226532 to your computer and use it in GitHub Desktop.
Save visionik/1226532 to your computer and use it in GitHub Desktop.
Tropo Tone Test
// Tropo Tone Test
var baseURI = "http://hosting.tropo.com/2038/www/";
var stop = false;
answer();
say( "Hello, and welcome to the Tropo Tone Tester.", {voice:"elizabeth"} );
while( !stop )
{
ask( "Simply select one through seven to commence tone testing.",
{
voice:"elizabeth",
choices:"[1 DIGIT]",
timeout:7.0,
onChoice: function(event)
{
num=parseInt( event.value );
if( num>0 && num<8 )
{
say( baseURI + "audio/tone-" + event.value + ".wav" );
}
else
{
say( "I am quite sorry, but " + event.value + "is not a valid selection.", {voice:"elizabeth"} );
}
},
onBadChoice: function(event)
{
say( "I am terribly sorry; unfortunately I did not understand you.", {voice:"elizabeth"});
},
onTimeout: function(event)
{
say( "Oh dear, it appears you did not select anything.", {voice:"elizabeth"} );
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment