안드로이드 개발 질문/답변
(글 수 45,052)
구글 음성 api 를 이용하는ㄷㅔ 영어랑 한글이랑 같이 결과값이 나옵니다.
결과를 한국어로만 받고 싶은데 어떻게 해야 할지를 모르겠습니다. ㅠㅜ
public void startVoiceRocognitionActivity(){
// TODO Auto-generated Method Stub
try{
Intent intent =new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
//요기를 어떻게 바꿔야 하는지 모르겠습니다.
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,5);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,"말하삼!");
startActivityForResult(intent,REQUEST_CODE);
}
catch(ActivityNotFoundException ex){
Toast.makeText(youandme.this,"Activity Not Found",Toast.LENGTH_LONG).show();
}
}
이것 같은데요?
public static final String EXTRA_LANGUAGE
Optional IETF language tag (as defined by BCP 47), for example "en-US". This tag informs the recognizer to perform speech recognition in a language different than the one set in the
getDefault()
.