smart-mirror icon indicating copy to clipboard operation
smart-mirror copied to clipboard

Speech recognition not working [Keyword Spotting]

Open mojosoeun opened this issue 10 years ago • 29 comments

Hello. From 9am to 4pm KST, voice recognition didn't work. But after that time it began working again. I'm trying to figure out why but I can't solve it.

mojosoeun avatar Mar 20 '16 12:03 mojosoeun

This is a known issue. My current theory is that because of the high volume of mirrors we are collectively using up Electron's Google speech key.

I am currently investigating solutions (and am open to suggestions)

evancohen avatar Mar 21 '16 03:03 evancohen

Any updated theory on this? I'm facing a very random issue where my code was working earlier in the day and suddenly stopped working, no voice detection.. nada..

Here's another issue I opened on annyang that details all my attempts https://github.com/TalAter/annyang/issues/188

shekit avatar Apr 12 '16 01:04 shekit

You are correct in you assumption that the issue is with key utilization (there have been may discussions about this on the gitter chat, which I suggest you check out).

I'm looking at alternatives (BlueMix, Microsoft, etc) as well as investigating offline Keyword Spotting to reduce quota usage.

evancohen avatar Apr 18 '16 07:04 evancohen

Another update: I've got keyword spotting functioning in the evancohen/keyword-spotting branch. There are a number of issues that exist with this implementation, namely poor performance and some comparability issues with certain microphone setups.

evancohen avatar Apr 20 '16 20:04 evancohen

I just set it up today and it seems I already made too many requests. I have my own Google API keys but in a matter of 2-3 minutes I made over 500 requests and now it seems to be down for me.

How do I add this branch to my existing git folder? ( on the raspberry )

shrimp69 avatar Apr 26 '16 13:04 shrimp69

I am still getting "Google speach recognizer is down :(" when I plug in any sort of microphone in to it. I have my Own Speech Keys. May I suggest that its a driver issue. Is it set to only be compatible with a list of mics? (PS: It was "Say "What Can I Say" to see a list of commands" when I unplug the microphone.)

skydazz avatar Apr 26 '16 14:04 skydazz

Also I get the "[1444:0426/103700:ERROR:logging.h(813)] Failed to call method: org.freedesktop.NetworkManager.GetDevices: object_path= /org/freedesktop/NetworkManager: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files" Message in the Terminal When I start it.

skydazz avatar Apr 26 '16 14:04 skydazz

I have started from scratch. I downgraded from Jessie to wheezy and I am following the documentation exactly as it is printed (except config.js). I am using a USB camera as a mic as it states in the documentation also. Will post results soon

skydazz avatar Apr 27 '16 01:04 skydazz

Ok, my issue now, still with sound, is getting the usb camera mic as the mic being used, I can use any USB sound device for anything. I have tried turtle beach px22 controller, USB sound card, and a USB camera

skydazz avatar Apr 27 '16 03:04 skydazz

@skydazz have you tried following the directions in the troubleshooting section of the documentation? You may also want to look at #20 (which was an old thread on the issue that may help you find an alternative solution)

evancohen avatar Apr 28 '16 16:04 evancohen

@skydazz Were you able to resolve the issue you had with " Failed to call method: org.freedesktop.NetworkManager.GetDevices: object_path= /org/freedesktop/NetworkManager: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files"

I have the same issue and can't figure out how to resolve it. Thanks.

Sachin1968 avatar Apr 29 '16 14:04 Sachin1968

@Sachin1968 that error is unrelated to this thread and is harmless - you can be safely ignore it. You can find more info on this Chromium forum post.

evancohen avatar Apr 29 '16 17:04 evancohen

So, another update for you all :) Keyword spotting officially works in the in the evancohen/keyword-spotting branch. Unfortunately the Pi is not quite powerful enough to process everything in real time. Because of that I've added a clap detector to that same branch, all you have to do is clap (a configurable number of times) and the mirror will start listening to you.

When using this branch on the Pi there are a few things you need to know You'll have to install sox (it's a dependency for clap detection)

sudo apt-get install sox

You will also have to run npm install after switching to this branch because of the new dependencies. Make sure you update your config.js file to reflect the new properties in config.example.js!

Since this is all very new stuff I haven't had the chance to test it extensively. I already anticipate there being issues with the clap detection microphone configuration, luckily this is totally something that you can set up. In your config you can use the clap override object to change the following settings for clap detection:

overrides : {
    AUDIO_SOURCE: 'hw:1,0', // this is your microphone input. If you don't know it you can refer to this thread (http://www.voxforge.org/home/docs/faq/faq/linux-how-to-determine-your-audio-cards-or-usb-mics-maximum-sampling-rate)
    DETECTION_PERCENTAGE_START : '5%', // minimum noise percentage threshold necessary to start recording sound
    DETECTION_PERCENTAGE_END: '5%',  // minimum noise percentage threshold necessary to stop recording sound
    CLAP_AMPLITUDE_THRESHOLD: 0.7, // minimum amplitude threshold to be considered as clap
    CLAP_ENERGY_THRESHOLD: 0.3,  // maximum energy threshold to be considered as clap
    MAX_HISTORY_LENGTH: 10 // all claps are stored in history, this is its max length
}

As always, if you have any questions you can post them here or ask on gitter.

When Commands aren't working Since commands are intermittent in the dev branch I've added a shim to Annyang to "simulate" a request. This can be done in the dev console with the following:

annyang.simulate("what can I say");

evancohen avatar May 02 '16 00:05 evancohen

@Keopss we'll get you sorted out in gitter :)

evancohen avatar May 13 '16 09:05 evancohen

I had the same problem with overusing my 50 speech API calls in about 10 minutes of use so I'm happy to test the new "clap" feature.

joerod avatar May 13 '16 15:05 joerod

Hi @evancohen ! i don´t know what happen with my rabs :(

I have installed smart-mirror-master and works fine.

Then i install sox and smart-smirror with keyword then edit config.js and add overrides options but no clap and speech detection.

Keopss avatar May 18 '16 07:05 Keopss

The geniuses over at http://kitt.ai have created an offline keyword spotter that should work. In order to find out I need your help to train the keyword "smart mirror". Just follow these steps:

  1. Go to https://snowboy.kitt.ai/hotword/47
  2. Click "Record and download the model"
  3. Follow the instructions to train the model (be sure to click "save" at the end!)

I'll continue to keep this thread updated with my progress and should hopefully have a working prototype this weekend!

evancohen avatar May 18 '16 23:05 evancohen

Hi! how gone? fine?

Keopss avatar May 23 '16 19:05 Keopss

I have a working implementation of keyword spotting, I'm currently trying to fix an issue on the Pi 3 that causes recognition to fail because of a native PulseAudio issue.

evancohen avatar May 23 '16 19:05 evancohen

Hello, I've succesfully installed smart mirror and I am very impressed!

However, I also get "Google Speech Recognizer is down"...

How long will it take for you to implement the new solution into the main branch?

Just an idea: Could you use jasper with pocketsphinx (http://jasperproject.github.io/) to train a number of keywords than then either activate Google STT or Amazon Alexa? Or is Kitt.ai definitely better for keyword recognition?

trenkert avatar May 23 '16 20:05 trenkert