From fd80746bb9d67be3a9f87dcb9264785a53631b74 Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczepaniak Date: Tue, 5 Aug 2014 11:49:32 +0100 Subject: Set the TTS voice name for the default language. This changes makes the initial, default language set and the #setLanguage call with the default language as input exactly the same. Previously, the requests made after the initial default language set were missing the name of the default voice. + Some tests clean-up. Some of them fail due to issues with Locale#toLanguageTag upper-casing the variant field. Change-Id: I5470617007fe45462b7198bf62a03eb5fe47a590 --- core/java/android/speech/tts/TextToSpeech.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/java/android/speech/tts') diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 0075d0b..7245975 100644 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java @@ -2029,6 +2029,11 @@ public class TextToSpeech { mParams.putString(Engine.KEY_PARAM_LANGUAGE, defaultLanguage[0]); mParams.putString(Engine.KEY_PARAM_COUNTRY, defaultLanguage[1]); mParams.putString(Engine.KEY_PARAM_VARIANT, defaultLanguage[2]); + + // Get the default voice for the locale. + String defaultVoiceName = mService.getDefaultVoiceNameFor( + defaultLanguage[0], defaultLanguage[1], defaultLanguage[2]); + mParams.putString(Engine.KEY_PARAM_VOICE_NAME, defaultVoiceName); } Log.i(TAG, "Set up connection to " + mName); -- cgit v1.1