I am trying to use Google Speech to Text api for Kannada language and I am setting EXTRA_LANGUAGE to "kn" for the same but it is not working.
Could somebody please help?
Below is the code I am using.
Locale locale = new Locale("kn");
//Locale.setDefault(locale);
Log.e(TAG, "Locale " + locale.getLanguage() + " present: " + isLocalePresent(locale));
if (isLocalePresent(locale)) {
//int randomInt = random.nextInt(allItemsLength);
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, locale.getLanguage());
//intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Try saying \"" + mergedFinalArray.get(randomInt) + "\"");
try {
startActivityForResult(intent, REQ_CODE_K2E_SPEECH_INPUT);
} catch (ActivityNotFoundException e) {
Toast.makeText(getApplicationContext(), R.string.missing_in_voc, Toast.LENGTH_SHORT).show();
}
}
Please note that the locale is present in the device. The same is working for other languages like Hindi (hi), Tamil (ta) and Japanese (ja) but not for Telugu (te), Malayalam (ml), Kannada (kn). Please help if I am doing anything wrong here.