I’m creating a personal assistant application, and I want it to turn on its voice recognition system (for example, Google’s voice keyboard) whenever a certain set of words is pronounced when the application is visible on the device’s screen. It is very similar to the already existing feature of the Samsung s3 galaxy, with which you can say "unlock" if the phone is in a locked state and the phone is unlocked.
I don’t know if voice recognition is an option for this (for example, keep the microphone turned on and start speaking with text when the microphone detects sound, so when the user speaks a keyword, the device will unlock), but I believe that it should be possible. In the worst case, I see that this is possible by matching the user's voice with existing audio files - although this would not be as accurate as the speech in the text. Therefore, STT definitely applies to my preferences.
So my question is:
1) Is it possible to make the phone CONSTANT (even if the application is not displayed, root access is not a problem) to listen to voice recognition and execute a line of code whenever certain words are said? If so, how? Keep in mind that battery resources are not related to my application.
source share