Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically override "Google Voice Search" over "Samsung powered by Vlingo"?

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:

  1. Is there a way to tell which speech recognition engines are installed? (If so, how?)
  2. Is there a way to tell which speech recognition engine is selected in the user settings? (If so, how?)
  3. Is there a programmatic way to override user's selection, so that my app always invokes Google Voice Search? (if so , how?)

Help will be appreciated

like image 324
Eternal Learner Avatar asked Mar 14 '13 02:03

Eternal Learner


People also ask

What is hands-free searching using Google Voice?

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.


1 Answers

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.)

like image 133
Kaarel Avatar answered Oct 07 '22 02:10

Kaarel