Feetech Serial Bus Servo icon Feetech Serial Bus Servo Control Feetech bus servos via EZB UART or PC COM in ARC; map Vx ports to IDs; supports position, speed, acceleration, release at 1M baud 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);