简体   繁体   English

文本到语音区域印地文印地文

[英]Text to Speech Locale Hindi Indian

I've created a Text to Speech Engine for Android that supports many languages, one of which is Hindi. 我为Android创建了一个支持多种语言的文本到语音引擎,其中一种语言是印地语。

In the Android Text to Speech Settings, when the user selects a default locale, Android does a number of checks including sending the intent ACTION_GET_SAMPLE_TEXT 在Android文本到语音设置中,当用户选择默认语言环境时,Android会执行多项检查,包括发送意图ACTION_GET_SAMPLE_TEXT

Here is my 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 every Locale other than "hi-IN", Android sends this intent and I respond with the example text and the "Listen to an example" button becomes available. 对于“hi-IN”以外的每个区域设置,Android都会发送此意图,我会回复示例文本并显示“收听示例”按钮。

I'm successfully returning LANG_COUNTRY_AVAILABLE from the call to onIsLanguageAvailable , but the buttons remain greyed out and it states that the language is not supported. 我成功地返回LANG_COUNTRY_AVAILABLE从呼叫onIsLanguageAvailable ,但按键仍然呈灰色,并指出,语言不被支持。

I've tried so many different ISO combinations of the locale: 我尝试了很多不同的语言环境ISO组合:

hin-IN, hi-IND, ind-HI etc etc etc, but Android doesn't send the Intent, despite it being labelled correctly in the Locale list as Hindi(Indian) or just Hindi. hin-IN,hi-IND,ind-HI等等,但Android不发送Intent,尽管它在Locale列表中被正确标记为印地语(印度语)或印地语。

There are no errors in the logcat to suggest a failed variant match. logcat中没有错误表明失败的变体匹配。

There's little point me posting my code, as Android simply doesn't send the Intent for this Locale, so it doesn't get to reach my code.... 我发布我的代码没什么意义,因为Android根本没有发送此Locale的Intent,因此它无法访问我的代码....

Any ideas how to correctly handle this locale variant? 任何想法如何正确处理这种语言环境变体?

EDIT: I've just realised it's also happening for Indonesian (in-IDN) 编辑:我刚刚意识到它也发生在印尼语(in-IDN)

TTS uses 3-letter codes * for language and locale . TTS使用3个字母的代码*来表示语言语言环境 So, based on that language/country code for: 因此,根据以下语言/国家/地区代码:

Hindi         hin-IND
Indonesian    ind-IDN

Hope this helps. 希望这可以帮助。


* This needs a proper citation from sources: I just made my conclusion based on existing TTS engine implementations. * 这需要从来源获得适当的引用:我刚刚根据现有的TTS引擎实现做出了结论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM