aboutsummaryrefslogtreecommitdiff
path: root/gui/gui-manager.cpp
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-14 23:39:26 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit5e44796d6b4c117daf95635588f7d4c83602791e (patch)
tree37f04355fb8a8e528733cd3d2efabbbdda35479e /gui/gui-manager.cpp
parent5ee30a1b7342c21db8b32d4e87bdfa300a27a2b4 (diff)
downloadscummvm-rg350-5e44796d6b4c117daf95635588f7d4c83602791e.tar.gz
scummvm-rg350-5e44796d6b4c117daf95635588f7d4c83602791e.tar.bz2
scummvm-rg350-5e44796d6b4c117daf95635588f7d4c83602791e.zip
TTS: Add correct language switching
Diffstat (limited to 'gui/gui-manager.cpp')
-rw-r--r--gui/gui-manager.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index f33fc39a6f..8cb201da3a 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -625,16 +625,21 @@ void GuiManager::setLastMousePos(int16 x, int16 y) {
#ifdef USE_TTS
void GuiManager::initTextToSpeech() {
-#if defined(USE_TRANSLATION) && defined(USE_LINUX_TTS)
- if(ConfMan.hasKey("gui_language") && ConfMan.get("gui_language") != "C")
- warning("TTS on linux is supported only for english");
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+#ifdef USE_TRANSLATION
+ Common::String currentLanguage = TransMan.getCurrentLanguage();
+ if (currentLanguage != "C") {
+ currentLanguage.setChar('\0', 2);
+ debug("%s", TransMan.getCurrentCharset().c_str());
+ ttsMan->setLanguage(currentLanguage);
+ }
#endif
int voice;
if(ConfMan.hasKey("tts_voice"))
voice = ConfMan.getInt("tts_voice", "scummvm");
else
voice = 0;
- g_system->getTextToSpeechManager()->setVoice(voice);
+ ttsMan->setVoice(voice);
}
#endif