The SpeechRecognition Package
The SpeechRecognition
package provides a high-level interface to record and process audio inputs in Python.
Reference:
Prerequisites
This package depends on another Python package called "pyaudio", which itself depends on a lower-level library caled "portaudio" (not a Python package). To install "portaudio":
On a Mac, use homebrew (
brew install portaudio
).On Windows, use pipwin within an active virtual environment (see installation steps below).
Installation
Do these installation steps after activating a virtual environment.
Windows:
Mac:
Usage
Recording Audio
Record audio using your computer's built-in microphone, and save that to a file:
Recognizing Speech
Record audio using your computer's built-in microphone, and recognize the spoken words:
Last updated