Created
September 19, 2011 13:43
-
-
Save visionik/1226523 to your computer and use it in GitHub Desktop.
Tropo Tone Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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