我正在尝试实现speech recognition
。我不断收到错误消息:
ERROR_NO_MATCH - No recognition result matched - 7
我找不到任何解释这意味着什么的东西。
"No recognition result matched"
是什么意思?
答案 0 :(得分:0)
您需要先启用部分结果,然后调用UNSTABLE_TEXT
// When creating the intent, set the partial flag to true
intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS,true);
使用onPartialResults()中返回的partialResults。在返回的捆绑软件中,“ SpeechRecognizer.RESULTS_RECOGNITION”具有减去最后一个术语的所有术语,而“ android.speech.extra.UNSTABLE_TEXT”具有最后一个缺少的识别术语。
@Override
public void onPartialResults(Bundle partialResults) {
ArrayList<String> data =
partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
ArrayList<String> unstableData =
partialResults.getStringArrayList("android.speech.extra.UNSTABLE_TEXT");
mResult = data.get(0) + unstableData.get(0);
}
您可以点击下面的链接以获得更好的理解-