以编程方式更改recognizerintent以识别英语以外的语言不起作用

时间:2014-02-10 02:07:06

标签: android recognizer-intent

我尝试了这两种方式,谷歌语音网络搜索仍然只识别英语。

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "ja-JP");
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "ja-JP");

2 个答案:

答案 0 :(得分:0)

尝试

Intent i = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "ja-JP");  

答案 1 :(得分:0)

尝试

String lang_code = "ja-JP";

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, lang_code);
i.putExtra(RecognizerIntent.EXTRA_PROMPT,"Hi speak something");