我SpeechRecognizer
直接使用,我已经实现了 custom RecognitionListener
。语音识别在除jelly bean之外的 android 上运行良好。果冻豆识别器无法检测到语音结束。
我的代码如下
speechRecognizer = SpeechRecognizer.createSpeechRecognizer(getApplicationContext());
speechRecognizer.setRecognitionListener(new CustomListener());
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
"com.somemodule");
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);
speechRecognizer.startListening(intent);
我错过了什么?我发现还有一个人在这里报告了这个问题,但没有人提供解决方案