Some devices (like Samsung Galaxy S3) come pre-installed with Samsung powered by Vlingo instead of Google Voice Search.
In my app, I would like to programmatically override which speech recognition engine to use, so that Google Voice Search is always used by my app.
So my questions are:
Help will be appreciated
What's It Do? Hands-free detection will allow Google's hotwords to enable Google Assistant regardless of the status of your phone. Whether it's unlocked and in use, or asleep on the table next to you, “OK Google” will wake the device and launch Assistant.
The answer to all your questions is "yes".
createSpeechRecognizer can be given the package name of the recognizer to use. So if you know the package name then you can override the default.
To detect the available services, use:
List<ResolveInfo> services =
getPackageManager().queryIntentServices(
new Intent(RecognitionService.SERVICE_INTERFACE), 0);
For more details study the source code of Babble. I don't know if this is the best way to do it (any feedback is welcome) but it has worked on my devices. (Babble in general assumes Android 4+, but the speech recognizer detection part might also work on earlier versions.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With