After Python Installation, Install all other depepndencies.
- If you’re on Debian-based Linux (like Ubuntu) you can install with apt:
pip install SpeechRecognition
sudo apt-get install python-pyaudio python3-pyaudio
- For macOS:
pip install SpeechRecognition
brew install portaudio
pip install python-pyaudio
- If using python3 on your local machine.
pip3 install SpeechRecognition
brew install portaudio
pip3 install python3-pyaudio
Once you’ve got PyAudio installed, you can test the installation from the console.
python -m speech_recognition
For Testing the code, run server:
python speech_to_text.py
- If using python3 on your local machine.
python3 speech_to_text.py