From b9d3c84db4e10cc0e55e4c2a12e288c17c7e66d2 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 16 Oct 2019 18:42:16 +0200 Subject: TTS: Fix language setting. --- backends/text-to-speech/linux/linux-text-to-speech.cpp | 4 ++-- backends/text-to-speech/windows/windows-text-to-speech.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'backends/text-to-speech') diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp index ccedb6bf6b..5943b69f49 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -330,8 +330,8 @@ void SpeechDispatcherManager::setVolume(unsigned volume) { void SpeechDispatcherManager::setLanguage(Common::String language) { if (_speechState == BROKEN) return; - spd_set_language(_connection, language.c_str()); - _ttsState->_language = language; + Common::TextToSpeechManager::setLanguage(language); + spd_set_language(_connection, _ttsState->_language.c_str()); setVoice(_ttsState->_activeVoice); } diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index 0e794d7baa..2b405f5553 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -338,9 +338,7 @@ void WindowsTextToSpeechManager::setVolume(unsigned volume) { } void WindowsTextToSpeechManager::setLanguage(Common::String language) { - if (language == "C") - language = "en"; - _ttsState->_language = language; + Common::TextToSpeechManager::setLanguage(language); updateVoices(); setVoice(0); } @@ -471,7 +469,7 @@ void WindowsTextToSpeechManager::updateVoices() { if (_ttsState->_availableVoices.empty()) { _speechState = NO_VOICE; - warning("No voice is available"); + warning("No voice is available for language: %s", _ttsState->_language.c_str()); } else if (_speechState == NO_VOICE) _speechState = READY; } -- cgit v1.2.3