HackerShackOfficial / AI-Smart-Mirror

Smart Mirror with a smart AI 🤖
MIT License
536 stars 217 forks source link

say "ok mirror" error #28

Open timolabs opened 7 years ago

timolabs commented 7 years ago

I am running in Mac OS, and virtual enviornment (hhsmartmirror) Chriss-MBP:AI-Smart-Mirror CG$

When I say launch phrase "ok mirror"

it throws error message as below,

log below

Found face I'm listening Found audio Traceback (most recent call last): File "bot.py", line 254, in bot.start() File "bot.py", line 44, in start if self.speech.is_call_to_action(recognizer, audio): File "/Users/CG/workspace/AI-Smart-Mirror/speech.py", line 44, in is_call_to_action speech = self.google_speech_recognition(recognizer, audio) File "/Users/CG/workspace/AI-Smart-Mirror/speech.py", line 20, in google_speech_recognition speech = recognizer.recognize_google(audio) File "/Users/CG/workspace/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in recognize_google best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"]) File "/Users/CG/workspace/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"]) KeyError: 'confidence'

when say other phrases, google will recognize but wont activate the mirror.

bloodynipple commented 7 years ago

I am having the same problem. Please let me know if anyone figures it out.

ghost commented 7 years ago

Try to disable the launche phrase in the bot.py use_launch_phrase = False

It worked for me

NelioJunior commented 6 years ago

To solve this, just enter lowercase caracteres in the contents of the variable use_launch_phrase and be happy!