Browse Source

SpeechSynthesis: test for and prevent duplicate voice entries

master
Reece H. Dunn 10 years ago
parent
commit
c14cfbf912

+ 1
- 0
android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java View File

@@ -116,6 +116,7 @@ public class SpeechSynthesisTest extends TextToSpeechTestCase
final SpeechSynthesis synth = new SpeechSynthesis(getContext(), mCallback);
mVoices = new HashMap<String, Voice>();
for (Voice voice : synth.getAvailableVoices()) {
assertThat(mVoices.get(voice.name), is(nullValue()));
mVoices.put(voice.name, voice);
}
assertThat(mVoices, is(notNullValue()));

+ 2
- 0
android/src/com/reecedunn/espeak/SpeechSynthesis.java View File

@@ -123,6 +123,8 @@ public class SpeechSynthesis {
if (name.equals("fa-pin")) {
// Android locales do not support scripts, so fa-Latn is not possible for Farsi Pinglish:
locale = null;
} else if (identifier.equals("asia/fa-en-us")) {
locale = null;
} else if (name.equals("om")) {
// This is an experimental voice that is not currently well tested to be used.
locale = null;

Loading…
Cancel
Save