Android Offline Speech Recognition shows only one result?

拈花ヽ惹草 提交于 2019-12-07 10:13:53

问题


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

来源:https://stackoverflow.com/questions/19403974/android-offline-speech-recognition-shows-only-one-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!