Audio.waitForSpeechRange(timeout, start, end, [increment])
|timeout||Time to wait in seconds before stopping waiting for speech.|
|start||numeric start value of the range|
|end||numeric end value of the range|
|increment||the increment of the range (optional)|
ReturnsThe value within the range as a number or the word "timeout" if timeout is reached.
Suspends execution of the script until one of the numbers within the range (start, end) is detected in the microphone, or a timeout occurs after timeout seconds. If a timeout occurs, the method will return "timeout".
If the number of options within the range is less than 10, each option will be displayed. For example, if the start is 10, and the end is 20, that means there will be 10 options so each option will be displayed.
If there are more than 10 options, the range will be displayed.
// Get a number from the user within the range between 10 and 20 response = Audio.waitForSpeechRange(10, 10, 20); Audio.say("You selected " + response); // Get a number from the user within the range between 10 and 20 incremented by 2 (every even number) response = Audio.waitForSpeechRange(10, 10, 20, 2); Audio.say("You selected " + response);