Skip to content

Instantly share code, notes, and snippets.

@KhanradCoder
Last active March 1, 2024 15:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save KhanradCoder/846f4dad00d2f8538f91b3e1896212d3 to your computer and use it in GitHub Desktop.
Save KhanradCoder/846f4dad00d2f8538f91b3e1896212d3 to your computer and use it in GitHub Desktop.
Simple implementation of speech recognition in python
# Install speech_recognition with pip install speech_recognition
# Install pyaudio with pip install pyaudio
# Make sure you look up full instructions for installing pyaudio
import speech_recognition as sr
recognizer = sr.Recognizer()
mic = sr.Microphone()
with mic as source:
audio = recognizer.listen(source)
output = recognizer.recognize_google(audio)
print(output)
@Levi0509
Copy link

Levi0509 commented Jan 6, 2021

When I tried ModuleNotFoundError comes up even after I installed speech_recognition module. What should I do?

@CaspanB
Copy link

CaspanB commented Jan 27, 2021

When I tried ModuleNotFoundError comes up even after I installed speech_recognition module. What should I do?

you need to do pip install SpeechRecognition

@nik4nao
Copy link

nik4nao commented Mar 8, 2021

Anyone know an updated way to get pyaudio installed cant find a correct way

@SysKeyyy
Copy link

peech_recognition.UnknownValueError am getting tis error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment