mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
DroidFish: Workaround for bug in Samsung text to speech implementation.
This commit is contained in:
parent
e1ea35409e
commit
140b4957fe
|
@ -68,7 +68,13 @@ public class Speech {
|
|||
initialized = true;
|
||||
int toast = -1;
|
||||
if (status == TextToSpeech.SUCCESS) {
|
||||
int code = tts.setLanguage(loc);
|
||||
int code = TextToSpeech.LANG_NOT_SUPPORTED;
|
||||
try {
|
||||
code = tts.setLanguage(loc);
|
||||
} catch (Throwable t) {
|
||||
// Some Samsung devices are broken and throw an
|
||||
// exception if the language is not supported
|
||||
}
|
||||
switch (code) {
|
||||
case TextToSpeech.LANG_AVAILABLE:
|
||||
case TextToSpeech.LANG_COUNTRY_AVAILABLE:
|
||||
|
@ -216,7 +222,7 @@ public class Speech {
|
|||
case EN:
|
||||
return Locale.US;
|
||||
case DE:
|
||||
return Locale.GERMAN;
|
||||
return Locale.GERMANY;
|
||||
case NONE:
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user