0
respostas

olá o código roda, porém não captura com microfone .

import speech_recognition as sr

def monitora_microfone
mi = sr.Recognizer()
with sr.Microphone() as source:
    print("Aguardando o comando")
    audio = mi.listen(source)

try:
    print(mi.recognize_google(language='pt-BR',audio))
except sr.UnknownValueError:
    print("Google Speech Recognition could not understand audio")
except sr.RequestError as e:
    print("Could not request results from Google speech recognition service; {0}".format(e))