I'm trying to figure out a way to use Speech Recognizer permanently. The goal is that my app will listen to what I am constantly saying and handles when I say "OK Phone".
I have tried this with Speech Recognizer in a service. So there was a loop, like when speech recognizer has finished to listen, it outputs the result and start listening again. Well, that was a bad idea and it didn't work well, because the speech recognizer was listening only for a short time. So there was a gap of a few seconds between the end of the speech and the beginning of the next speech.
As I have realized that the speech recognizer doesn't provide permanent listening, I have tried it with the library PocketSphinx. I have bad experience with that library since it can't match the words clearly as Speech Recognizer from Google does.
I also thought about recording an audio and then passing it to Speech Recognizer. The problem with this is that it would not work in real-time.
However, I am running out of ideas. Instead of using any libraries, I would like to understand how Google is able to listen to you and matches when you say "OK Google".
Any ideas would be appreciated!