vendredi 22 juillet 2016

Speech recognition for Python 3.4 thats easy to work?

I wish to get a simple speech recognition that works. I have been looking at this on speech_recognition, When I execute the code the following error occurs

import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:                
    audio = r.listen(source)                  

try:
    print("You said " + r.recognize(audio))    
except LookupError:                            




print("You said " + r.recognize(audio))    # recognize speech using Google       Speech Recognition
AttributeError: 'Recognizer' object has no attribute 'recognize'

    print("Could not understand audio")

This was copied from their examples on their web page

Aucun commentaire:

Enregistrer un commentaire