Reputation: 79
I want to check if a specific language pack (Google Text-to-Speech) is available or not.
t1=new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if(t1.isLanguageAvailable(new Locale("bn_BD")) >= TextToSpeech.LANG_AVAILABLE)
{
// Set language
}
}
});
but the problem is t1.isLanguageAvailable(new Locale("bn_BD")) is always returing false even the language is available and also working this voice.
Upvotes: 2
Views: 553
Reputation: 7437
You must construct the Locale object using separate strings for the language and country like this:
new Locale("bn", "BD")
Upvotes: 1