aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-23 10:52:17 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commitd2b9b9ef21d09fb36d20c289bab3a8d035717c31 (patch)
treeb9b5dcdb0334baecb4246e66aee7e00502679a13 /engines/mortevielle
parent063107083340c9572250c75347ff4b7880a1770b (diff)
downloadscummvm-rg350-d2b9b9ef21d09fb36d20c289bab3a8d035717c31.tar.gz
scummvm-rg350-d2b9b9ef21d09fb36d20c289bab3a8d035717c31.tar.bz2
scummvm-rg350-d2b9b9ef21d09fb36d20c289bab3a8d035717c31.zip
MORTEVIELLE: Map characters to different voices
Diffstat (limited to 'engines/mortevielle')
-rw-r--r--engines/mortevielle/sound.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index a986db47f6..96b4cdbfa3 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -788,15 +788,18 @@ void SoundManager::startSpeech(int rep, int ht, int typ) {
return;
Common::Array<int> voices;
int pitch;
+ int voiceIndex;
bool male;
if (ht > 5) {
voices = _ttsMan->getVoiceIndicesByGender(Common::TTSVoice::FEMALE);
pitch = ht - 6;
+ voiceIndex = pitch;
pitch *= 5;
male = false;
} else {
voices = _ttsMan->getVoiceIndicesByGender(Common::TTSVoice::MALE);
pitch = ht - 5;
+ voiceIndex = -pitch;
pitch *= 4;
male = true;
}
@@ -805,7 +808,9 @@ void SoundManager::startSpeech(int rep, int ht, int typ) {
if (voices.empty())
_ttsMan->setVoice(0);
else {
- _ttsMan->setVoice(voices[0]);
+ voiceIndex %= voices.size();
+ _ttsMan->setVoice(voices[voiceIndex]);
+ debug("voice set: %d", voices[voiceIndex]);
}
// If the selected voice is a different gender, than we want, just try to
// set the pitch so it may sound a little bit closer to the gender we want