diff --git a/android/eSpeakTests/src/com/reecedunn/espeak/test/TextToSpeechTest.java b/android/eSpeakTests/src/com/reecedunn/espeak/test/TextToSpeechTest.java index b99096bd..37c4d7ca 100644 --- a/android/eSpeakTests/src/com/reecedunn/espeak/test/TextToSpeechTest.java +++ b/android/eSpeakTests/src/com/reecedunn/espeak/test/TextToSpeechTest.java @@ -123,20 +123,23 @@ public class TextToSpeechTest extends TextToSpeechTestCase assertThat(data, is(notNullValue())); assertThat(voice.getName(), is(data.name)); - assertThat(voice.getLocale().getLanguage(), is(data.ianaLanguage)); - assertThat(voice.getLocale().getCountry(), is(data.ianaCountry)); + assertThat(voice.getLocale().getLanguage(), is(data.javaLanguage)); + assertThat(voice.getLocale().getCountry(), is(data.javaCountry)); assertThat(voice.getLocale().getVariant(), is(data.variant)); assertThat(voice.getFeatures(), is(nullValue())); assertThat(voice.getLatency(), is(android.speech.tts.Voice.LATENCY_VERY_LOW)); assertThat(voice.getQuality(), is(android.speech.tts.Voice.QUALITY_NORMAL)); getEngine().setVoice(voice); + assertThat(getLanguage(getEngine()).getLanguage(), is(data.javaLanguage)); + assertThat(getLanguage(getEngine()).getCountry(), is(data.javaCountry)); + assertThat(getLanguage(getEngine()).getVariant(), is(data.variant)); android.speech.tts.Voice voice2 = getEngine().getVoice(); assertThat(voice2, is(notNullValue())); assertThat(voice2.getName(), is(data.name)); - assertThat(voice2.getLocale().getLanguage(), is(data.ianaLanguage)); - assertThat(voice2.getLocale().getCountry(), is(data.ianaCountry)); + assertThat(voice2.getLocale().getLanguage(), is(data.javaLanguage)); + assertThat(voice2.getLocale().getCountry(), is(data.javaCountry)); assertThat(voice2.getLocale().getVariant(), is(data.variant)); assertThat(voice2.getFeatures(), is(nullValue())); assertThat(voice2.getLatency(), is(android.speech.tts.Voice.LATENCY_VERY_LOW)); diff --git a/android/src/com/reecedunn/espeak/TtsService.java b/android/src/com/reecedunn/espeak/TtsService.java index 9920b5c3..f1ccfaa0 100644 --- a/android/src/com/reecedunn/espeak/TtsService.java +++ b/android/src/com/reecedunn/espeak/TtsService.java @@ -221,7 +221,7 @@ public class TtsService extends TextToSpeechService { for (Voice voice : mAvailableVoices.values()) { int quality = android.speech.tts.Voice.QUALITY_NORMAL; int latency = android.speech.tts.Voice.LATENCY_VERY_LOW; - voices.add(new android.speech.tts.Voice(voice.name, voice.locale, quality, latency, false, null)); + voices.add(new android.speech.tts.Voice(voice.name, new Locale(voice.locale.getISO3Language(), voice.locale.getISO3Country(), voice.locale.getVariant()), quality, latency, false, null)); } return voices; }