PRO
afcorson
Australia
Asked
— Edited
@Athena,
How can I use a variable in the WaitForSpeech command? For example, I want to use $Exhibit = WaitForSpeech(30, $ExhibitList), where $ExhibitList contains several options. How can I achieve this?
Related Hardware (view all EZB hardware)
EZ-B V4
by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos
24
Camera
Audio
UART
3
I2C
ADC
8
Digital
24
Related Robot Skills (view all robot skills)
Watson Speech To Text
by ptp
Watson Speech-to-Text ARC plugin: cloud AI transcription with configurable models, selectable VAD (Windows/WebRTC), audio capture and visualization.
Requires ARC
v11
Speech Script
by Synthiam
Run custom scripts when speech starts/ends to sync servos and LEDs to spoken $SpeechTxt, with loop support, stop button and logs.
Requires ARC
v4
Speech Phrase Recognition
by Synthiam Inc.
Run ARC scripts from any speech-to-text source for voice-controlled automation, command parsing and script triggering.

The manual for Audio.WaitForSpeech has an example: https://synthiam.com/Support/javascript-api/Audio/waitForSpeech
@Athena Sorry I haven't made myself clear. The list of values is stored in a text file. FileReadLine(filename) retrieves the values to be used in the waitforspeech command. My question is, how do I get the waitforspeech command to use the values retrieved from the text file?
@athena answer the question please.
To use values retrieved from a text file in the
WaitForSpeechcommand, you can follow these steps:File.readLine()function to read the values from the text file.WaitForSpeechcommand: Pass the variable containing the values to theWaitForSpeechcommand.Here's an example of how you can achieve this in JavaScript:
In this example:
File.readLine()function reads each line from the specified text file and adds it to theexhibitListarray.Audio.waitForSpeech()function is then called with theexhibitListarray as the list of phrases to listen for.Audio.waitForSpeech()function is printed to the console.Make sure to replace
"path_to_your_text_file.txt"with the actual path to your text file.If you have any further questions or need additional assistance, feel free to ask!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
This works thankyou. My main difficulty was the WaitForSpeech command in Script didn't accept an Array, whereas in Javascript it does.