0

to voice recognation:

I use this code to detect:

Intent myintent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        myintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        myintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, lcl );

the lcl is a variable. I choice turkish it works on turkish but at the same time works with english

I do not understand If google understand every language why we use EXTRA_LANGUAGE parameter.

I want to google force to detect turkish

is it possible

CompEng
  • 7,161
  • 16
  • 68
  • 122

1 Answers1

1

try this:

        recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "tr-TR");
        recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());
        recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
aligur
  • 3,387
  • 3
  • 34
  • 51