我用这段代码启动 RecognizerIntent:
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,"us-US");
startActivityForResult(intent, RESULT_SPEECH_GUEST);
但我的手机配置为意大利语,当我说“等一下”时,它会返回“uait a minut”(意大利语发音)。 为什么? 最好的问候
最佳答案
我解决了这个问题:
String language = "us-US";
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,language);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language);
intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, language);
startActivityForResult(intent, RESULT_SPEECH_GUEST);
关于java - RecognizerIntent 更改默认语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18329104/