aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorJames Brown2002-05-07 11:48:34 +0000
committerJames Brown2002-05-07 11:48:34 +0000
commite2df4d2b3bfc9fc9f6b3e6de2d5c02ff3178022b (patch)
treef760bac2a616348d9482eace191ace7d5611208d /sound.cpp
parent5a4ed65edaa236f372633ee5596c3c77c8317a9d (diff)
downloadscummvm-rg350-e2df4d2b3bfc9fc9f6b3e6de2d5c02ff3178022b.tar.gz
scummvm-rg350-e2df4d2b3bfc9fc9f6b3e6de2d5c02ff3178022b.tar.bz2
scummvm-rg350-e2df4d2b3bfc9fc9f6b3e6de2d5c02ff3178022b.zip
Added rate detection for The Dig - solves problems with other language versions.
svn-id: r4226
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound.cpp b/sound.cpp
index f1e6ee9796..3c2316f8b7 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -760,6 +760,7 @@ void Scumm::decompressBundleSound(int index) {
}
{ /* Parse decompressed data */
+ int rate = 22050;
byte *ptr = CompFinal;
int tag, size;
tag = READ_BE_UINT32(ptr); ptr+=4;
@@ -770,10 +771,13 @@ void Scumm::decompressBundleSound(int index) {
}
ptr+=12; /* Skip header */
- while(tag != MKID_BE('DATA')) {
+ while(tag != MKID_BE('DATA')) {
tag = READ_BE_UINT32(ptr); ptr+=4;
switch(tag) {
- case MKID_BE('FRMT'):
+ case MKID_BE('FRMT'):
+ size = READ_BE_UINT32(ptr); ptr+=16;
+ rate = READ_BE_UINT32(ptr); ptr+=8;
+ break;
case MKID_BE('TEXT'):
case MKID_BE('REGN'):
case MKID_BE('STOP'):
@@ -791,7 +795,7 @@ void Scumm::decompressBundleSound(int index) {
Final = (unsigned char *)malloc(size);
memcpy(&Final[0], &ptr[0], size);
- _mixer->play_raw(NULL, Final, size, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ _mixer->play_raw(NULL, Final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
free(CompFinal);
}
}