Audio and Voice Tutorial
RoboCrew allows your robot to listen for voice commands using wake-word detection and respond verbally using Text-to-Speech (TTS). This creates a hands-free “Intelligence Loop” where the robot perceives, reasons, and acts based on your spoken instructions.
1. Enabling Voice in the Agent
Section titled “1. Enabling Voice in the Agent”To utilize audio features, you must provide a microphone device index and enable the TTS flag during the initialization of the LLMAgent or XLeRobotAgent.
Basic Configuration
Section titled “Basic Configuration”2. Audio Hardware Setup
Section titled “2. Audio Hardware Setup”Before running the code, ensure your system has the necessary audio libraries installed for handling microphone input:
3. How Listening Works
Section titled “3. How Listening Works”The audio system runs through a SoundReceiver class that manages background recording and transcription:
- Continuous Listening: The robot monitors the environment for a specific volume threshold (RMS).
- Wake-word Detection: It records audio segments and transcribes them. If the defined
wakewordis detected in the transcription, the entire phrase is set as the agent’s new active task. - Task Updates: While the robot is idle or performing a task, it continuously checks the
task_queuefor new verbal instructions.