diff options
author | Eugene Sandulenko | 2005-10-21 02:00:12 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-10-21 02:00:12 +0000 |
commit | 37fbcf61adcc4c42581c6fd3ee0735b8b4a0d2df (patch) | |
tree | 4e1418227213be8c294d9be78f136eb60fff6179 /scumm | |
parent | 79f5ecb1bbb7c8db503043385b3dc2a5b2313e7a (diff) | |
download | scummvm-rg350-37fbcf61adcc4c42581c6fd3ee0735b8b4a0d2df.tar.gz scummvm-rg350-37fbcf61adcc4c42581c6fd3ee0735b8b4a0d2df.tar.bz2 scummvm-rg350-37fbcf61adcc4c42581c6fd3ee0735b8b4a0d2df.zip |
Fix MS IMA ADPCM decoder. I like Microsoft so much for reinventing another
standard.
svn-id: r19203
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sound.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 326934da64..8273304cf4 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -308,18 +308,20 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) { // Support for later Backyard sports games sounds else if (READ_UINT32(ptr) == MKID('RIFF')) { uint16 type; + int blockAlign; size = READ_LE_UINT32(ptr + 4); Common::MemoryReadStream stream(ptr, size); - if (!loadWAVFromStream(stream, size, rate, flags, &type)) { + if (!loadWAVFromStream(stream, size, rate, flags, &type, &blockAlign)) { error("playSound: Not a valid WAV file"); } if (type == 17) { - AudioStream *voxStream = new ADPCMInputStream(&stream, size, kADPCMIma, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1); + AudioStream *voxStream = new ADPCMInputStream(&stream, size, kADPCMIma, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign); sound = (char *)malloc(size * 4); size = voxStream->readBuffer((int16*)sound, size * 2); + size *= 2; // 16bits. } else { // Allocate a sound buffer, copy the data into it, and play sound = (char *)malloc(size); |