Index>Robot Kit>Alter All in One Kit for RPi>Lesson 14 Open Source Speech Recognition Library
No related product information!

Lesson 14 Open Source Speech Recognition Library

1010

In this lesson, we will learn how to use an open source speech recognition library.

     PyAudio is a Python library for cross-platform audio I/O processing. SpeechRecognition is a speech recognition library. SpeechRecognition does not need to build a script to access the microphone and process audio files from scratch. It only takes a few minutes to automatically complete audio input, retrieval and operation.


14.1 Downloading and installing speech recognition library

1. Open the terminal software MobaXterm:


image.png


2. Log in to your Raspberry Pi (the way to log in to Raspberry Pi has been introduced in Lesson 1):

image.png


3. Enter the Course Code folder, this folder stores the sample code program to control the robot, enter the following command:

cd adeept_alter/02CourseCode/01ComponentCode

image.png


4. Enter the command to display the contents of the current directory:

ls

image.png


5. The 13Speech folder stores the sample code of this course. Enter the command to enter this folder:

cd  13Speech

image.png


6. Enter the command to display the contents of the current directory:

ls

image.png


7. Before running this program, we need to make some settings. You need to install the pyaudio library first, and enter the following commands in the command window:

sudo apt-get install -y swig portaudio19-dev python3-all-dev python3-pyaudio flac

image.png


8.After the download is complete, enter the following command to run the speech.py program:

sudo python3 speech.py

image.png