result = tts.setLanguage(Locale.CHINA);
if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
Log.e("TTS", "This Language is not supported");
}
I have some text that are in English inside my string which I believe is the cause of the log message which says that the language is not supported.
My question is that is there a way to by pass this exception or should I try to eliminate all the English words on my string then perform the translation?
Also another question is “what other possible exceptions of failure to TextToSpeech?”.
EDIT: this answer is obsolete. Android supports Chinese now.
Android does not support Chinese out of the box. The docs state:
A Chinese engine might be available for download on the Market. Try the one called “SVOX Classic” – it supports downloadable voices for a large variety of languages.
Also, see this question.