Camera Device icon Camera Device Use PC or robot cameras for vision tracking: color, QR, glyph, face, object, motion; record video/data, control servos and movement, run scripts 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);