I need to use a background service to launch my application with voice command even when the screen is locked. For example when I say "start" the screen will be unlocked and the application launches automatically, I tried to make this code work https://github.com/gast-lib/gast-lib/blob/master/library/src/root/gast/speech/activation/SpeechActivationService.java but I don't know how to use that and how to do the service with the activity .
Asked
Active
Viewed 1,229 times
1 Answers
0
I'll recommend using CMUSphinx to recognize speech continuously. To achieve continuous speech recognition using google speech recognition api, you might have to resort to a loop in a background service which will take too much resources and drains the device battery.
On the other hand, Pocketsphinx works really great. It's fast enough to spot a key phrase and recognize voice commands behind the lock screen without users touching their device. And it does all this offline. You can try the demo.
If you really want to use google's api as I've demonstrated above, see this

Community
- 1
- 1

Nana Ghartey
- 7,901
- 1
- 24
- 26
-
so how can i make the battery don't lose resources ? – touta_touta Mar 29 '15 at 16:00
-
by decreasing the number of times you automatically listen for speech – Nana Ghartey Mar 30 '15 at 11:20