Programmatically changing recognizerintent to recognize a language other than English not working

StackOverflow https://stackoverflow.com/questions/21667938

  •  09-10-2022
  •  | 
  •  

質問

I tried both of these ways and the google voice web search is still only recognizing English.

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "ja-JP");
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "ja-JP");
役に立ちましたか?

解決

Try

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");  

他のヒント

Try

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");
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top