-3

def takeCommand():

r = sr.Recognizer()
with sr.Microphone() as source:
    print("Listening...")
    r.pause_threshold = 0.8
    audio = r.listen(source)

try:
    print("Recognizing...")    
    query = r.recognize_google(audio, language='en-in')
    print("User said: {} \n".format(query))

except Exception as e:
    # print(e)    
    print("Say that again please...")  
    return "None"
return query

above code is not taking voice from microphone

1 Answers1

0

just install pyaudio using the conda install and it will work the same .