Text to speech locale hindi indian

I created a Text to Speech Engine for Android that supports many languages, one of which is Hindi.

In the Android Text to Speech settings, when the user selects the standard locale, Android performs a number of checks, including sending the intent ACTION_GET_SAMPLE_TEXT

Here is a list of supported locales:

private static final String[] SUPPORTED_LANGUAGES = { "eng-GBR", "eng-USA", "fra-FRA", "spa-ESP", "deu-DEU", "ita-ITA", "kor-KOR", "nld-NLD", "dan-DNK", "fin-FIN", "jpn-JPN", "nor-NOR", "pol-POL", "por-PRT", "por-BRA", "rus-RUS", "swe-SWE", "zho-CHN", "zho-HKG", "zho-TWN", "ara-SAU", "hi-IN", "ces-CZE", "ell-GRC", "hun-HUN", "ron-ROU", "slk-SVK", "tha-THA", "tur-TUR", "cym-GBR", "isl-ISL", "in-IDN" }; 

For each Locale other than "hi-IN", Android sends this intention, and I respond to the text of the example, and the "Listen to example" button becomes available.

I successfully return LANG_COUNTRY_AVAILABLE from the onIsLanguageAvailable call, but the buttons remain gray and indicate that the language is not supported.

I tried so many different ISO combinations from the locale:

hin-IN, hi-IND, ind-HI, etc. etc., but Android does not send an Intent, despite the fact that it is correctly marked in the Locale list as Hindi (Indian) or just Hindi.

There are no errors in logcat to suggest matching options.

It makes little sense to me to write my code, since Android just does not send an intent for this Locale, so it does not reach my code ....

Any ideas how to properly handle this locale option?

EDIT: I just realized this is happening for the Indonesian (in-IDN) as well.

+7
android locale text-to-speech
source share
1 answer

TTS uses 3-letter codes * for language and locale . So, based on this language / country code for:

 Hindi hin-IND Indonesian ind-IDN 

Hope this helps.


* This requires a correct quote from sources: I just made my conclusion based on existing versions of the TTS engine.
+5
source share

All Articles