daanzu / kaldi-active-grammar

Python Kaldi speech recognition with grammars that can be set active/inactive dynamically at decode-time
GNU Affero General Public License v3.0
334 stars 49 forks source link

Feature Request: going to sleep after minutes of inactivity #10

Closed shervinemami closed 4 years ago

shervinemami commented 4 years ago

DNS engine automatically goes to sleep after roughly 5 minutes of inactivity, which is a nice feature to reduce the possibility of commands being detected from random noises while we're away from the computer such as if we've run off to the bathroom! The user has to say "start listening" or similar to wake it up.

If it's easy to add an inactivity timeout to the kaldi backend, that would be handy!

LexiconCode commented 4 years ago

Using recognition observers this should be possible with a timer and mimic.

The last successful recognized recognition starts a timer and the timer resets with another successful recognition.

When the timer expires it mimics the command to silence the microphone.

shervinemami commented 4 years ago

Thanks @LexiconCode , good idea! I'll implement it in 2 weeks time and submit a PR to this repo.

daanzu commented 4 years ago

Yeah, recognition observers with a timer is probably the best approach. The best place for it is probably as an option in the kaldi_module_loader_plus.py in the dragonfly2 repository.