How can I use RecognizerIntent to force using Turkish?

87 views Asked by At

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

1

There are 1 answers

1
kokoko On

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