1

I want to recognize only English with Kotlin Android. But my phone uses the Korean language setting.

My app returns Korean first. But I want only English text. Please help me. Below is my code:

val rintent = Intent( RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
        rintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE , Locale.US)
        rintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, Locale.US);
        rintent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE , true )
        rintent.putExtra( RecognizerIntent.EXTRA_LANGUAGE_MODEL , RecognizerIntent.LANGUAGE_MODEL_FREE_FORM )
        rintent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS , 3 )
dmcgrandle
  • 5,934
  • 1
  • 19
  • 38

0 Answers0