【发布时间】:2014-09-22 01:55:49
【问题描述】:
您可以在最新的谷歌搜索设置上设置多种语音语言。 但问题是 SpeechRecognizer 只能识别默认语言。
我实现了...
private SpeechRecognizer mGoogleRecognizer;
private void startRecognition() {
mGoogleRecognizer = SpeechRecognizer.createSpeechRecognizer(m_context);
mGoogleRecognizer.setRecognitionListener(this);
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "ko-KR");
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Intellectual Personal Assistant");
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, m_context.getPackageName());
mGoogleRecognizer.startListening(intent);
}
@Override
public void onResults(Bundle results) {
ArrayList<String> resultList = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
}
我请求识别韩语,但结果列表仅包含默认语言的结果。
我怎样才能得到正确的结果?
谢谢。
【问题讨论】:
-
此问题已在最新的 Google 搜索中得到修复。 :)
标签: android speech-recognition