evancohen / smart-mirror

The fairest of them all. A DIY voice controlled smart mirror with IoT integration.
http://smart-mirror.io
2.8k stars 694 forks source link

Google speech api usage #571

Closed talk2abhisv closed 7 years ago

talk2abhisv commented 7 years ago

How to reduce google speech api usage

Hi interesting project, any way to reduce the google speech api calls. I unchecked continuous in mirror setting and put in some new hot words but mirror still seem to need network connectivity to work ?

justbill2020 commented 7 years ago

google cloud speech api is online only... there's no offline access... hotwords only trigger the google speech api to start listening. you will not be able to control the mirror using hotwords... the purpose of having multiple hotwords is to improve hotword detection for multiple users. or to allow multiple hotwords to trigger listening... use case 1 would be 4 people in your house. one personal model file (i.e. smart_mirror.pmdl) works for 2 of the users and not for the others. We would in this use case recommend each user creating their own pmdl file and entering it in the Remote ConfigUI speech settings. use case 2 would be you want to be able to say "smart-mirror", "Snow boy", and "Wubalubadubdub" you would train each personal model, and then enter those in the Remote ConfigUI speech setting. after that all 3 of those hotwords would trigger listening via Google Cloud Speech API.

I will say this... i use my mirror a ton with testing cause like... who wants to type in annyang.trigger('some command') when i can speak during testing. and i've never received a bill yet.

i know this likely isn't the answer you want but its the answer.

I'm going to close this as a resolved question.

talk2abhisv commented 7 years ago

I trained few more hotwords and added .pmdl files to smart-mirror root directory. In mirror setting added the "Keyword Spotter Hotwords". When i say Hi / Hello in front of the mic, 'hi', 'hello' gets displayed at bottom of screen which means mirror is already listening & sending to google even without detecting horword ? I can confirm this by turning off wifi then the Hi / Hello is not displayed. Am i missing a setting to get the hot word detection to trigger google speech api without always calling (Continuous Enabled checkbox is unchecked). Thanks

evancohen commented 7 years ago

@talk2abhisv can you provide a video of this? I'm not sure I'm understanding your problem. The mirror should only start streaming after your custom hotword is detected, and then should automatically stop detecting after a single utterance.

talk2abhisv commented 7 years ago

Hi Evan, good work from you guys on this project. Found the issue - my microphone setting was set to 0.8 and kept on firing random hotword detected for any sound. Setting back to 0.5 made it pretty reliable again.