https://github.com/realpython/python-speech-recognition
Speech Recognition with Python examples
https://github.com/realpython/python-speech-recognition
Last synced: 9 months ago
JSON representation
Speech Recognition with Python examples
- Host: GitHub
- URL: https://github.com/realpython/python-speech-recognition
- Owner: realpython
- License: mit
- Created: 2018-03-15T22:50:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T04:19:53.000Z (about 5 years ago)
- Last Synced: 2025-03-22T22:55:07.020Z (9 months ago)
- Language: Python
- Homepage: https://realpython.com/python-speech-recognition/
- Size: 2.18 MB
- Stars: 246
- Watchers: 14
- Forks: 185
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Speech Recognition with Python
This repository contains resources from [The Ultimate Guide to Speech Recognition with Python](https://realpython.com/python-speech-recognition/) tutorial on Real Python.
Audio files for the examples in the *Working With Audio Files* section of the post can be found in the `audio_files` directory. To download them, use the green "Clone or download" button at the top right corner of this page.
The `guessing_game.py` file contains the full source code for the "Guess a Word" game example.
> **NOTE**: You will need to install the [SpeechRecognition](https://github.com/Uberi/speech_recognition) and [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/) packages in order to run the example. Please see the [tutorial](https://realpython.com/python-speech-recognition/) for step-by-step instructions.
You can test your SpeechRecognition and PyAudio installation by downloading `guessing_game.py` and typing the following into a Python REPL session:
```pycon
>>> import speech_recognition as sr
>>> from guessing_game.py import recognize_speech_from_mic
>>> r = sr.Recognizer()
>>> m = sr.Microphone()
>>> recognize_speech_from_mic(r, m) # speak after running this line
{'success': True, 'error': None, 'transcription': 'hello'}
```
Of course, your output will vary depending on what you said after running `recognize_speech_from_mic(r, m)`.