Android Offline Speech Recognition shows only one

2019-05-06 05:23发布

I've set a speech recognition service as shown in this post Android Speech Recognition as a service on Android 4.1 & 4.2 and when I use the offline recognition (putting the phone in plane mode) it only shows me 1 result in the onResults() while in online mode I always get more than 5 results.

I use this Intent :

mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                                     RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
                                     this.getPackageName());
    mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "fr-FR");
    mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);

I switched to english and it did the same. I also tried Web search instead of Free form.

I would like to know if there is some magic code to make it work or if it's just impossible to combine multiple results with offline recognition.

Thank you in advance

0条回答
登录 后发表回答