Skip to content

Instantly share code, notes, and snippets.

@radralph
Last active March 3, 2017 01:30
Show Gist options
  • Save radralph/9383350 to your computer and use it in GitHub Desktop.
Save radralph/9383350 to your computer and use it in GitHub Desktop.
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