aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorTravis Howell2004-07-14 04:54:06 +0000
committerTravis Howell2004-07-14 04:54:06 +0000
commitc7e39d4191f1f9eae19abb9a9a92aeea2f745a60 (patch)
tree0076123a17973fa5e645f89c4737c4a10588478d /scumm/sound.cpp
parent485b3380ccafc030067543903ace161cbc5dab9a (diff)
downloadscummvm-rg350-c7e39d4191f1f9eae19abb9a9a92aeea2f745a60.tar.gz
scummvm-rg350-c7e39d4191f1f9eae19abb9a9a92aeea2f745a60.tar.bz2
scummvm-rg350-c7e39d4191f1f9eae19abb9a9a92aeea2f745a60.zip
Fix speech in HE games.
svn-id: r14207
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index f7ce771002..8a4f58d511 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -597,16 +597,19 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle
return;
}
- // FIXME hack until more is known
- // the size of the data after the sample isn't known
- // 64 is just a guess
if (_vm->_features & GF_HUMONGOUS) {
- // SKIP TLKB (8) TALK (8) HSHD (24) and SDAT (8)
_sfxMode |= mode;
- _sfxFile->seek(offset + 48, SEEK_SET);
- sound = (byte *)malloc(b - 64);
- _sfxFile->read(sound, b - 64);
- _vm->_mixer->playRaw(handle, sound, b - 64, 11025, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+
+ // SKIP TALK (8) HSHD (14)
+ _sfxFile->seek(offset + 22, SEEK_SET);
+ int rate = _sfxFile->readUint16LE();
+ // SKIP HSHD (8) and SDAT (8)
+ _sfxFile->seek(+16, SEEK_CUR);
+
+ size = b - 40;
+ sound = (byte *)malloc(size);
+ _sfxFile->read(sound, size);
+ _vm->_mixer->playRaw(handle, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
return;
}
@@ -711,7 +714,6 @@ int Sound::isSoundRunning(int sound) const {
} else if (sound == -1 || sound == 10000 || sound == _currentMusic) {
// getSoundStatus(), with a -1, will return the
// ID number of the first active music it finds.
- // TODO handle MRAW (pcm music) in humongous games
if (_currentMusic)
return (_musicChannelHandle.isActive()) ? _currentMusic : 0;
else