The voice is recorded into a wav file through the external sound card of the nano, and the voice recognition is achieved with the voice library pocketsphinx, which can be recognized offline. This function has a higher recognition rate for English, but a poorer recognition rate for Chinese.
<aside> 💡 Note: Before running the command, please make sure that the programs in other terminals have been terminated. The termination command is: Ctrl+c.
</aside>
Enter the following command in the terminal. When “recording” appears in the terminal, start to record the voice. After 3 seconds, the recording is complete, and “Done” will appear on the terminal.
rosrun voice demo_record_voice.py
After the voice is recorded, enter the command in the terminal:
rosrun voice demo_voice2word.py output.wav
9.2 Voice control
9.2.1 Function Introduction
Control Limo to move ahead, move back, turn right, and turn left by saying ahead, back, right and left to Limo.
9.2.2 Running function
Note: Before running the command, please make sure that the p
roslaunch limo_base limo_base.launch
rosrun voice voice_ctr_node.py