openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
606 stars 314 forks source link

Enable AlwaysOnHotwordDetector for Wall Mounted Tablets #210

Closed joefrank25 closed 3 years ago

joefrank25 commented 8 years ago

Starting with API 21, Android allows developers to use the "hotword" detector to determine when someone wants to execute a voice command. This is the same functionality that powers the "OK Google" feature on most devices.

We should add an optional hotword detector with a configurable phrase so that it is possible to speak commands to wall mounted tablets without having to touch the microphone button on the app.

The details are documented here: https://developer.android.com/reference/android/service/voice/AlwaysOnHotwordDetector.html

It's unclear if it is possible to tie directly into the hotword detector, so we may need to use the generic "voice actions" as documented here:

https://developers.google.com/voice-actions/system/

Does anyone have experience working with this functionality?

cribskip commented 6 years ago

Hey, I took a look at https://snowboy.kitt.ai which is supported by amazon, powered by a neutral network, enables custom keywords and works offline.

Shall I give it a go? Quick setup with tasker based activation seems promising.

joefrank25 commented 6 years ago

Sure, @cribskip, give it a go!

cribskip commented 6 years ago

Just thoughts of today's night: Before I'm implementing this, is the Apache License from snowboy compatible to the Eclipse Public License of habdroid?

praharshbhatt commented 6 years ago

Snowboy is awesome, go for it! I implemented my project here: https://play.google.com/store/apps/details?id=com.multiverse.jarvis&hl=en

cribskip commented 6 years ago

If time permits, I'll take a look at this tutorial and start working on it: https://itnext.io/how-to-easily-command-your-app-with-hotword-detection-1001e582c46e

cribskip commented 6 years ago

Ok, so I took a look at the example and it seems pretty straight-forward - beside my IDE being on Windows :-( I'll try to implement it without swig and will test this way. Should take me about one week for a prototype... look forward ;-)

Btw, did someone notice parsetron?

And please note, someone already started training "openhab" on kitt.ai: https://snowboy.kitt.ai/hotword/15508

Scherzin83 commented 3 years ago

Hi is there any plans to implement this feature or is they’re already a workaround for using a Hotword?

mueller-ma commented 3 years ago

I don't have any plans to implement this, but I'd review a PR implementing it.

mueller-ma commented 3 years ago

IMO the Google Assistant can do the same: https://github.com/openhab/openhab-android/issues/2394#issuecomment-767716581