isRecognitionAvailable return false on android

2k views Asked by At

I'm using the android.speech.SpeechRecognizer on Android. In some cases, isRecognitionAvailable return false, so I can't recognize the speech. Is there no way to enable android.speech.SpeechRecognizer on Phone? Or is there similar service ?

4

There are 4 answers

2
josedlujan On BEST ANSWER

If SpeechRecognizer.isRecognitionAvailable(this) returns false your device has no SpeechRecognizer support. Is simple.

Check documentation

2
Joshua On

Is there no way to enable android.speech.SpeechRecognizer on Phone? Or is there similar service ?

No, SpeechRecognizer is a SYSTEM service. If it is not available, then there is not such service on the device. Here is the quote from documentation.

Checks whether a speech recognition service is available on the system.

If you really want speech recognition, you can record the mic input and process the raw input yourself.

0
BochenChleba On

If you are targeting API 30 or higher, add the following to manifest file, outside application block:

<queries>
    <intent>
        <action android:name="android.speech.RecognitionService" />
    </intent>
</queries>
1
mgonzalez On

I know that it has passed too much time but this may help somebody.

I run into a very strange issue. I knew that speech recognizer once worked in my Android 5.1.1 phone. However, isRecognitionAvailable started to return false. However, createSpeechRecognizer was creating the object (although it didnt start listening). It was strange because according to documentation:

isRecognitionAvailable:

Checks whether a speech recognition service is available on the system. If this method returns false, createSpeechRecognizer(Context) will fail.

I ended up going into PlayStore and looking for "Ok google" and I found that Google LLC was disabled. I enabled it and Speech Recognizer started to work again.

Hope this helps anyone