Ticket #8076: sbl.diff
File sbl.diff, 2.3 KB (added by , 22 years ago) |
---|
-
scummvm/scumm/sound.cpp
diff -ur ScummVM-cvs20021001/scummvm/scumm/sound.cpp ScummVM-cvs20021001+hack/scummvm/scumm/sound.cpp
old new 248 248 else if (READ_UINT32_UNALIGNED(ptr) == MKID('SBL ')) { 249 249 debug(2, "Using SBL sound effect"); 250 250 251 // TODO - Figuring out how the SBL chunk works. Here's an252 // example:251 // TODO - Figuring out how the SBL chunk works. Here's 252 // an example: 253 253 // 254 254 // 53 42 4c 20 00 00 11 ae |SBL ....| 255 255 // 41 55 68 64 00 00 00 03 |AUhd....| … … 259 259 // 7e 7f 7f 80 80 7f 7f 7f |~.......| 260 260 // 7f 80 80 7f 7e 7d 7d 7e |....~}}~| 261 261 // 7e 7e 7e 7e 7e 7e 7e 7f |~~~~~~~.| 262 // 7f 7f 7f 80 80 80 80 80 |........|263 // 80 81 80 80 7f 7f 80 85 |........|264 // 8b 8b 83 78 72 6d 6f 75 |...xrmou|265 // 7a 78 77 7d 83 84 83 81 |zxw}....|266 262 // 267 // The length of the AUhd chunk always seems to be 3 bytes.268 // Let's skip that for now.263 // The length of the AUhd chunk always seems to be 3 264 // bytes. Let's skip that for now. 269 265 // 270 // The starting offset, length and sample rate is all pure 271 // guesswork. The result sounds reasonable to me, but I've 272 // never heard the original. 273 266 // The starting offset, length and sample rate is all 267 // pure guesswork. The result sounds reasonable to me, 268 // but I've never heard the original. 269 // 270 // I've since discovered that the non-interactive 271 // Sam & Max demo also uses SBL sound effects, but 272 // with different sub-chunks. Example: 273 // 274 // 53 42 4c 20 00 01 15 6e |SBL ...n| 275 // 57 56 68 64 00 00 00 03 |WVhd....| 276 // 00 00 80 57 56 64 74 00 |...WVdt.| 277 // 01 15 5b 01 56 15 01 a6 |..[.V...| 278 // 00 80 80 80 80 80 80 80 |........| 279 // 80 80 80 80 80 80 80 80 |........| 280 // 80 80 80 80 80 80 80 80 |........| 281 // 80 80 80 80 80 80 80 80 |........| 282 // 283 // I'm going to assume that the sample frequency is 284 // the only important difference between the two. 285 286 if (READ_UINT32_UNALIGNED(ptr + 8) == MKID('WVhd')) 287 rate = 11025; 288 else 289 rate = 8000; 290 274 291 size = READ_BE_UINT32_UNALIGNED(ptr + 4) - 27; 275 rate = 8000;276 292 277 293 // Allocate a sound buffer, copy the data into it, and play 278 294 char *sound = (char*)malloc(size);