Last active
May 16, 2018 01:52
-
-
Save radralph/18c5636e4ec603dd94a2d9ff30986e43 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 "Please choose a color from red, blue or green.", { | |
:choices => "red, blue, green", | |
:recognizer => "en-PH", | |
:timeout => 20, | |
:bargein => true, | |
:mode => "speech", | |
:minConfidence => 0.6, | |
: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? "red" | |
say "you chose red" | |
elsif result.value.eql? "blue" | |
say "you chose blue" | |
elsif result.value.eql? "green" | |
say "you chose green" | |
else | |
say "ASR not working" | |
end | |
say "goodbye" | |
hangup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment