Skip to content

Instantly share code, notes, and snippets.

@MayankFawkes
Created October 1, 2019 20:00
Show Gist options
  • Select an option

  • Save MayankFawkes/64917680653e2b4a010e45d75c0387bd to your computer and use it in GitHub Desktop.

Select an option

Save MayankFawkes/64917680653e2b4a010e45d75c0387bd to your computer and use it in GitHub Desktop.
lets talk with your program script for voice recognition
#!/usr/bin/env python
# encoding=utf-8
# pip install pyaudio and pip install SpeechRecognition
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("Speak Anything :")
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print("You said : {}".format(text))
except:
print("Sorry could not recognize what you said")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment