From 58047cef67ac06972fa6ce17bbc94700bf0e864c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 30 Oct 2014 14:23:58 +0000 Subject: [PATCH] [Android 5.0] TTS settings crashes on hye-arevmda --- .../espeak/test/SpeechSynthesisTest.java | 25 ------------------- .../com/reecedunn/espeak/test/VoiceData.java | 2 +- .../com/reecedunn/espeak/SpeechSynthesis.java | 2 +- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java b/android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java index f45f984c..46e7c297 100644 --- a/android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java +++ b/android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java @@ -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" diff --git a/android/eSpeakTests/src/com/reecedunn/espeak/test/VoiceData.java b/android/eSpeakTests/src/com/reecedunn/espeak/test/VoiceData.java index 4bee2acc..832a8263 100644 --- a/android/eSpeakTests/src/com/reecedunn/espeak/test/VoiceData.java +++ b/android/eSpeakTests/src/com/reecedunn/espeak/test/VoiceData.java @@ -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"), diff --git a/android/src/com/reecedunn/espeak/SpeechSynthesis.java b/android/src/com/reecedunn/espeak/SpeechSynthesis.java index 17d93898..245ac0e9 100644 --- a/android/src/com/reecedunn/espeak/SpeechSynthesis.java +++ b/android/src/com/reecedunn/espeak/SpeechSynthesis.java @@ -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");