#raise AttributeError("Could not find PyAudio; check installation")
# AttributeError: Could not find PyAudio; check installation
# I have tried every type of pip or sudo type of commands but its # not working it just says PyAudio is missing
import speech_recognition as sr
# get audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Speak:")
audio = r.listen(source)
try:
print("You said " + r.recognize_google(audio))
except sr.UnknownValueError:
print("Could not understand audio")
except sr.RequestError as e:
print("Could not request results; {0}".format(e))