Reputation: 813
I would like to speak "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 have followed the link below and installed the tts package for "cantonese", but I still would not set "Cantonese" in my app. However, if I use Ekho tts engine, it would achieve the desired result but the voice is a bit strange versus google engine.
Upvotes: 4
Views: 2978
Reputation: 126
You may want to try tts.setLanguage(new Locale("zh", "HK"))
or tts.setLanguage(new Locale("yue", "HK"))
.
TRADITIONAL_CHINESE most likely refers to the writing, not to the spoken language. Taiwan for example uses traditional writing, but the spoken language is Mandarin (zh_TW). Cantonese is spoken in Hong Kong, therefore the "HK" variant should be used. Recent changes in Google's tts consider Cantonese ("yue") to be a different language altogether.
Upvotes: 9