aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle/sound.cpp
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-25 21:28:08 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit990ab617939c301b49fa6399180d4370deeb0461 (patch)
treeb0056224ea569fe27cc8031a8daf9554cba797e4 /engines/mortevielle/sound.cpp
parenta1f69e6b06160d75ff85a0c292c88709abc4f7e9 (diff)
downloadscummvm-rg350-990ab617939c301b49fa6399180d4370deeb0461.tar.gz
scummvm-rg350-990ab617939c301b49fa6399180d4370deeb0461.tar.bz2
scummvm-rg350-990ab617939c301b49fa6399180d4370deeb0461.zip
MORTEVIELLE: Improve voice mapping to characters.
* Return pitch -= 6 to females, this brings the pitch closer to zero * Add array of indices which ensures, that we use as many voices as we can.
Diffstat (limited to 'engines/mortevielle/sound.cpp')
-rw-r--r--engines/mortevielle/sound.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 01a9dbbaac..841a184d7a 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -772,25 +772,28 @@ void SoundManager::startSpeech(int rep, int character, int typ) {
// Speech
#ifdef USE_TTS
const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
+ const int voiceIndices[9] = { 0, 1, 2, 3, 0, 4, 5, 1, 6 };
if (!_ttsMan)
return;
Common::Array<int> voices;
- int pitch = haut[character] * 5;
+ int pitch = haut[character];
bool male;
if (haut[character] > 5) {
voices = _ttsMan->getVoiceIndicesByGender(Common::TTSVoice::FEMALE);
male = false;
+ pitch -= 6;
} else {
voices = _ttsMan->getVoiceIndicesByGender(Common::TTSVoice::MALE);
male = true;
}
+ pitch *= 5;
// If there is no voice available for the given gender, just set it to the 0th
// voice
if (voices.empty())
_ttsMan->setVoice(0);
else {
- character %= voices.size();
- _ttsMan->setVoice(voices[character]);
+ int voiceIndex = voiceIndices[character] % voices.size();
+ _ttsMan->setVoice(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