evancohen / sonus

:speech_balloon: /so.nus/ STT (speech to text) for Node with offline hotword detection
MIT License
619 stars 79 forks source link

CloudSpeechRecognizer connection status #34

Open lpercifield opened 7 years ago

lpercifield commented 7 years ago

Great work BTW!

I'm interested in understanding if there is a way to detect the status of the cloud speech recognizer. I'm working on an embedded application and would love to be able to display an "offline" if the recognizer socket has disconnected or if the connection fails. Currently it fails silently.

Tested by disconnecting network and running any sonus example.

I looked through the google cloud docs and didn't see anything obvious.

Hopefully it's a quick fix, or you can point me to the google module that does it.

Thanks again, Leif

evancohen commented 7 years ago

I've been looking for the docs on this as well. It doesn't seem like it's obviously exposed. Ideally sonus could trigger the error event with context saying that there is a connection issue, but I haven't been able to find any documentation about it in their speech library. Maybe it'd better to look at the grpc lib?

scargill commented 7 years ago

That's really a must. Amazon DOT comes back with a red light and "I'm sorry but I'm having trouble understanding right now".

evancohen commented 7 years ago

Totally agreed. I'm still looking for a good way to do this and am open to suggestions :)

lpercifield commented 7 years ago

I opened an issue with in the google repo, seems like there might be something doing on their end: https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1993

evancohen commented 7 years ago

It seems that this is now exposed! I should have time to implement it this weekend :)