Last active
March 3, 2017 01:30
-
-
Save radralph/9383350 to your computer and use it in GitHub Desktop.
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
wait(1500) | |
say "Starting to test ASR..." | |
result = ask "Choose from Tom, Nancy or Jeff.", { | |
:choices => "Tom, Nancy, Jeff", | |
:recognizer => "en-PH", | |
:timeout => 20, | |
:bargein => true, | |
:mode => "speech", | |
:onChoice => lambda { |event| | |
say "On Choice" | |
}, | |
:onBadChoice => lambda { |event| | |
say "On Bad Choice" | |
}, | |
:onTimeout => lambda { |event| | |
say "we didn't receive your input" | |
} | |
} | |
if result.value.eql? "Tom" | |
say "you chose Tom" | |
elsif result.value.eql? "Nancy" | |
say "you chose Nancy" | |
elsif result.value.eql? "Jeff" | |
say "you chose Jeff" | |
else | |
say "ASR not working" | |
end | |
hangup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment