0

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!

xRay
  • 543
  • 1
  • 5
  • 29
  • Pretty sure this is baked into the operating system and not a feature any app can use. I would be very surprised if there was a way to write an app to do this. – Louis Wasserman Nov 28 '21 at 18:34
  • @LouisWasserman if so, how is the PocketSphinx library able to do it? – xRay Nov 28 '21 at 18:48
  • In a java project for PC, I combined picovoice porcupine and rhino for wake word detection and simple command processing. Both projects should be available for android as well, maybe have a look at the demo files in their github repositories. – floxbr Nov 28 '21 at 18:55
  • In addition to the fact that Google Assistant has system level permissions, they probably have access to hardware/Manufacturer SDK like [Qualcomm's Voice Assist](https://www.qualcomm.com/products/features/voice-assist) which takes advantage of low power always on listening. – Morrison Chang Nov 28 '21 at 19:41
  • @floxbr Thank you for sharing this info. Picovoice/Porcupine is very useful! – xRay Dec 05 '21 at 11:13

0 Answers0