aci*_*tal 58 android speech-recognition
我用android.speech.SpeechRecognizer它DICTATION_MODE来识别很长一段时间内的命令.在此模式下,对回调方法的调用onPartialResults比正常模式下的延迟要多得多.有谁知道为什么会发生这种情况以及如何避免这种延迟?
这是我用于的配置SpeechRecognizer:
Intent recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
recognizerIntent.putExtra("calling_package", mainActivity.getApplicationContext().getPackageName());
recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 100);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2071 次 |
| 最近记录: |