List of usage examples for android.speech.tts TextToSpeech isLanguageAvailable
public int isLanguageAvailable(final Locale loc)
From source file:Main.java
/** * get a descriptions of all the languages available as determined by * {@link TextToSpeech#isLanguageAvailable(Locale)} *///from w w w .j a va 2 s . c o m public static String getLanguageAvailableDescription(TextToSpeech tts) { StringBuilder sb = new StringBuilder(); for (Locale loc : Locale.getAvailableLocales()) { int availableCheck = tts.isLanguageAvailable(loc); sb.append(loc.toString()).append(" "); switch (availableCheck) { case TextToSpeech.LANG_AVAILABLE: break; case TextToSpeech.LANG_COUNTRY_AVAILABLE: sb.append("COUNTRY_AVAILABLE"); break; case TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE: sb.append("COUNTRY_VAR_AVAILABLE"); break; case TextToSpeech.LANG_MISSING_DATA: sb.append("MISSING_DATA"); break; case TextToSpeech.LANG_NOT_SUPPORTED: sb.append("NOT_SUPPORTED"); break; } sb.append(NEW_LINE); } return sb.toString(); }