diff --git a/engines/glk/glk.cpp b/engines/glk/glk.cpp index f2a796191af..7acf4d3a6af 100644 --- a/engines/glk/glk.cpp +++ b/engines/glk/glk.cpp @@ -38,6 +38,7 @@ #include "glk/screen.h" #include "glk/selection.h" #include "glk/sound.h" +#include "glk/speech.h" #include "glk/streams.h" #include "glk/windows.h" @@ -271,6 +272,8 @@ void GlkEngine::syncSoundSettings() { int volume = ConfMan.getBool("sfx_mute") ? 0 : CLIP(ConfMan.getInt("sfx_volume"), 0, 255); _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, volume); + + SpeechManager::syncSoundSettings(); } void GlkEngine::beep() { diff --git a/engines/glk/speech.cpp b/engines/glk/speech.cpp index c812a973b16..6707db1bc05 100644 --- a/engines/glk/speech.cpp +++ b/engines/glk/speech.cpp @@ -51,6 +51,19 @@ void SpeechManager::releaseSpeechManagerInstance() { } } +void SpeechManager::syncSoundSettings() { +#if defined(USE_TTS) + debugC(kDebugSpeech, "SpeechManager::syncSoundSettings"); + if (_instance && _instance->_ttsMan) { + int volume = (ConfMan.getInt("speech_volume") * 100) / 256; + if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) + volume = 0; + debugC(kDebugSpeech, "Set speech volume to %d", volume); + _instance->_ttsMan->setVolume(volume); + } +#endif +} + SpeechManager::SpeechManager() : _refCount(0) #if defined(USE_TTS) @@ -68,7 +81,7 @@ SpeechManager::SpeechManager() : _ttsMan->setLanguage(ConfMan.get("language")); // Volume int volume = (ConfMan.getInt("speech_volume") * 100) / 256; - if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) + if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) volume = 0; _ttsMan->setVolume(volume); // Voice diff --git a/engines/glk/speech.h b/engines/glk/speech.h index 5dfd62809eb..400531dfa9c 100644 --- a/engines/glk/speech.h +++ b/engines/glk/speech.h @@ -45,6 +45,8 @@ public: void purgeSpeech(Speech *); void addSpeech(const uint32 *buf, size_t len, Speech *); + static void syncSoundSettings(); + private: SpeechManager(); ~SpeechManager();