Browse Source

SpeechSynthesis.java: fix getAvailableVoices() on Android 4.3

master
Reece H. Dunn 12 years ago
parent
commit
fc9bc0e55d
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      android/src/com/reecedunn/espeak/SpeechSynthesis.java

+ 10
- 3
android/src/com/reecedunn/espeak/SpeechSynthesis.java View File

import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.MissingResourceException;


public class SpeechSynthesis { public class SpeechSynthesis {
private static final String TAG = SpeechSynthesis.class.getSimpleName(); private static final String TAG = SpeechSynthesis.class.getSimpleName();
} }
} }


if (locale != null && !locale.getISO3Language().equals("")) {
final Voice voice = new Voice(name, identifier, gender, age, locale);
voices.add(voice);
try {
if (locale != null && !locale.getISO3Language().equals("")) {
final Voice voice = new Voice(name, identifier, gender, age, locale);
voices.add(voice);
}
} catch (MissingResourceException e) {
// Android 4.3 throws this exception if the 3-letter language
// code is missing for a locale (e.g. nci). Earlier versions
// of Android return an empty string.
} }
} }



Loading…
Cancel
Save