Skip to content

Instantly share code, notes, and snippets.

@adameubanks
Last active September 2, 2024 08:26
Show Gist options
  • Select an option

  • Save adameubanks/846f4dad00d2f8538f91b3e1896212d3 to your computer and use it in GitHub Desktop.

Select an option

Save adameubanks/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

Levi0509 commented Jan 6, 2021

Copy link
Copy Markdown

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

@CaspanB

CaspanB commented Jan 27, 2021

Copy link
Copy Markdown

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

nik4nao commented Mar 8, 2021

Copy link
Copy Markdown

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

@SysKeyyy

Copy link
Copy Markdown

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