Android Text-To-Speech speaks Cantonese with an “alphabet” programmatically

I would like to say “A13” with “A” pronounced in “English” and “13” in “Cantonese”; Below is the code I used, but it just gives me "13" in Putonghua.

tts.setLanguage(Locale.ENGLISH);
tts.speak("A", TextToSpeech.QUEUE_FLUSH, null);

tts.setLanguage(Locale.TRADITIONAL_CHINESE);
tts.speak("13", TextToSpeech.QUEUE_FLUSH, null);

I followed the link below and installed the tts package for “Cantonese”, but I still did not install “Cantonese” in my application. However, if I use the Ekho tts engine, it will achieve the desired result, but the voice is a bit strange against the Google engine.

http://www.android-apk.com/2015/07/google-tts-%E6%96%87%E5%AD%97%E8%BD%89%E8%AA%9E%E9%9F%B3 % E5% B7% B2% E6% 94% AF% E6% 8F% B4-% E7% B2% B5% E8% AA% 9E-% E5% 92% 8C-% E4% B8% AD% E6% 96% 87 /

+4
source share
1 answer

You can try tts.setLanguage(new Locale("zh", "HK"))or tts.setLanguage(new Locale("yue", "HK")). TRADITIONAL_CHINESE most likely refers to writing, not colloquial speech. For example, Taiwan uses traditional writing, but Mandarin (zh_TW) is the spoken language. Cantonese dialect is spoken in Hong Kong, so the "HK" option should be used. Recent changes to Google tts consider Cantonese ("yue") a completely different language.

+6
source

All Articles