RGB 8X8 Animator icon RGB 8X8 Animator Create, edit and play animated frames on an RGB 8x8 LED matrix via I2C with looping, adjustable pauses and scriptable EZ-Script canvas control. Try it →
 

Waitforanynumberspeech

Audio.waitForAnyNumberSpeech(timeout, prompt)

Parameters

timeout Time to wait in seconds before stopping waiting for speech.
prompt The text prompt to display to the user while listening for speech

Returns

The number heard if the timeout did not occur in a lowercase string.

Description

Suspends execution of the script until any number is detected in the microphone or a timeout occurs after timeout seconds. If a timeout occurs, the method will return "timeout" in lowercase. The number can include a minus sign and a decimal point. 


Example

// Listen for any response from the user
response = Audio.waitForAnyNumberSpeech(30, "Give me a number");

print("Heard: " + response);