aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-18 12:19:47 -0700
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit4d9572073192a3cefe7b148a27197c2ca9f60087 (patch)
tree4e0ef6abed7d05b7380b6840ad0b0cdff8361af7 /gui
parent5d9f03e71d75a307c8f8e538803fe2f09f38c5ae (diff)
downloadscummvm-rg350-4d9572073192a3cefe7b148a27197c2ca9f60087.tar.gz
scummvm-rg350-4d9572073192a3cefe7b148a27197c2ca9f60087.tar.bz2
scummvm-rg350-4d9572073192a3cefe7b148a27197c2ca9f60087.zip
TTS: Fix voice setting on startup
The ScummVM was crashing because of an assert, when there was less voices availaible, than what was set in the ConfMan. Now the voice just falls back to 0th voice, if there are not enough voices.
Diffstat (limited to 'gui')
-rw-r--r--gui/gui-manager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index b149908ffe..82f7591ae8 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -645,6 +645,8 @@ void GuiManager::initTextToSpeech() {
voice = ConfMan.getInt("tts_voice", "scummvm");
else
voice = 0;
+ if (voice >= ttsMan->getVoicesArray().size())
+ voice = 0;
ttsMan->setVoice(voice);
}
#endif