Browse Source

[Android 5.0] TTS settings crashes on hye-arevmda

master
Reece H. Dunn 10 years ago
parent
commit
58047cef67

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

@@ -285,31 +285,6 @@ public class SpeechSynthesisTest extends TextToSpeechTestCase
assertThat(voice.match(fra_BEL_1694acad), isTtsLangCode(TextToSpeech.LANG_AVAILABLE));
}

public void testMatchVoiceWithLanguageAndVariant()
{
final Voice voice = getVoice("hy-west"); // language="hy" country="" variant="arevmda"
assertThat(voice, is(notNullValue()));

assertThat(voice.match(fr), isTtsLangCode(TextToSpeech.LANG_NOT_SUPPORTED));
assertThat(voice.match(fr_BE), isTtsLangCode(TextToSpeech.LANG_NOT_SUPPORTED));
assertThat(voice.match(fr_1694acad), isTtsLangCode(TextToSpeech.LANG_NOT_SUPPORTED));
assertThat(voice.match(fr_FR_1694acad), isTtsLangCode(TextToSpeech.LANG_NOT_SUPPORTED));

assertThat(voice.match(hy), isTtsLangCode(TextToSpeech.LANG_COUNTRY_AVAILABLE));
assertThat(voice.match(hy_AM), isTtsLangCode(TextToSpeech.LANG_AVAILABLE));
assertThat(voice.match(hy_arevela), isTtsLangCode(TextToSpeech.LANG_COUNTRY_AVAILABLE));
assertThat(voice.match(hy_arevmda), isTtsLangCode(TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE));
assertThat(voice.match(hy_AM_arevela), isTtsLangCode(TextToSpeech.LANG_AVAILABLE));
assertThat(voice.match(hy_AM_arevmda), isTtsLangCode(TextToSpeech.LANG_AVAILABLE)); // NOTE: Android does not support LANG_VAR_AVAILABLE.

assertThat(voice.match(hye), isTtsLangCode(TextToSpeech.LANG_COUNTRY_AVAILABLE));
assertThat(voice.match(hye_ARM), isTtsLangCode(TextToSpeech.LANG_AVAILABLE));
assertThat(voice.match(hye_arevela), isTtsLangCode(TextToSpeech.LANG_COUNTRY_AVAILABLE));
assertThat(voice.match(hye_arevmda), isTtsLangCode(TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE));
assertThat(voice.match(hye_ARM_arevela), isTtsLangCode(TextToSpeech.LANG_AVAILABLE));
assertThat(voice.match(hye_ARM_arevmda), isTtsLangCode(TextToSpeech.LANG_AVAILABLE)); // NOTE: Android does not support LANG_VAR_AVAILABLE.
}

public void testMatchVoiceWithLanguageCountryAndVariant()
{
final Voice voice = getVoice("en-sc"); // language="en" country="GB" variant="scotland"

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

@@ -139,7 +139,7 @@ public class VoiceData
new Voice("hr", "europe/hr", "hr", "hrv", "", "", "", SpeechSynthesis.GENDER_MALE, "Croatian", "hrv", "Ovo je primjer teksta izgovorenog na hrvatski"),
new Voice("hu", "europe/hu", "hu", "hun", "", "", "", SpeechSynthesis.GENDER_MALE, "Hungarian", "hun", "Ez egy magyar nyelven felolvasott szöveg mintája."),
new Voice("hy", "asia/hy", "hy", "hye", "", "", "", SpeechSynthesis.GENDER_MALE, "Armenian", "hye", "This is a sample of text spoken in Armenian", "This is a sample of text spoken in հայերեն"),
new Voice("hy-west", "asia/hy-west", "hy", "hye", "", "", "arevmda", SpeechSynthesis.GENDER_MALE, "Armenian (Western)", "hye-arevmda", "This is a sample of text spoken in Armenian (Western Armenian)", "This is a sample of text spoken in հայերեն (AREVMDA)"),
// new Voice("hy-west", "asia/hy-west", "hy", "hye", "", "", "arevmda", SpeechSynthesis.GENDER_MALE, "Armenian (Western)", "hye-arevmda", "This is a sample of text spoken in Armenian (Western Armenian)", "This is a sample of text spoken in հայերեն (AREVMDA)"),
new Voice("ia", "other/ia", "ia", "ina", "", "", "", SpeechSynthesis.GENDER_UNSPECIFIED, "Interlingua", "ina", "This is a sample of text spoken in Interlingua"),
new Voice("id", "asia/id", "in", "ind", "", "", "", SpeechSynthesis.GENDER_MALE, "Indonesia", "ind", "Ini adalah sebuah contoh teks yang diucapkan di Bahasa Indonesia"), // NOTE: 'id' is the correct ISO 639-1 code, but Android/Java uses 'in'.
new Voice("is", "europe/is", "is", "isl", "", "", "", SpeechSynthesis.GENDER_MALE, "Icelandic", "isl", "This is a sample of text spoken in íslenska", "This is a sample of text spoken in Icelandic"),

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

@@ -139,7 +139,7 @@ public class SpeechSynthesis {
locale = new Locale("es", "MX");
} else if (name.equals("hy-west")) {
// 'west' is not a country code.
locale = new Locale("hy", "", "arevmda");
locale = null;
} else if (name.equals("vi-hue")) {
// 'hue' is for the Hue Province accent/dialect (Central Vietnamese).
locale = new Locale("vi", "VN", "hue");

Loading…
Cancel
Save