3

我使用以下代码启动 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”(意大利语发音)。为什么?此致

4

1 回答 1

11

我解决了这个问题:

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);
于 2013-08-20T07:53:29.573 回答