Welcome to Voice interaction module repository
RPI code
1. Learning Objectives
In this course, we mainly learn to use the Raspberry Pi and the voice interaction module to realize the recognition and broadcast.
2. Preparation
The voice interaction module adopts UART communication or USB communication. Here we take USB communication as an example.
Use the type-c cable to connect the Raspberry Pi and the voice module, run the command ls /dev | grep 'ttyUSB' , you can see that the voice module is recognized as USB0
Wiring

3. Code
Please check this code file: speech_moudle.py
Initialize the USB interface
Speech broadcast function
Speech recognition function
Main loop function
4. Run code
Enter the command python3 speech_moudle.py in the terminal to run the code.
5. Experimental phenomenon
After the code is run, it starts to initialize the USB port. If the initialization is successful, it will print "Speech Serial Opened! Baudrate=115200", otherwise it will print "Speech Serial Open Failed!".
If there is an error, you need to check the wiring or USB port, and then start to identify the broadcast.
You can say: “Hi, Yahboom”, the speaker will reply: “Hi, i am here”. The terminal will print: hi.
You can say: “ Close light”, the speaker will reply: OK, lights is closed. The terminal will print: OK.