小编dex*_*tto的帖子

使用Google搜索版本3.6.14.1337016的SpeechRecognizer无法识别除默认语言之外的其他语音语言

您可以在最新的Google搜索设置中设置多种语音语言.但问题是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);
}
Run Code Online (Sandbox Code Playgroud)

我要求对韩语进行识别,但resultList仅包含默认语言的结果.

我怎样才能得到正确的结果?

谢谢.

android speech-recognition

8
推荐指数
1
解决办法
2342
查看次数

标签 统计

android ×1

speech-recognition ×1