aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorOliver Kiehl2002-11-11 13:55:29 +0000
committerOliver Kiehl2002-11-11 13:55:29 +0000
commit1c86b35f2a81a909ddd00ff05c88eeb4e4a974a5 (patch)
treea2cc1db38381f9be5b3519966e1fba7bdd5a2eb9 /simon
parented4e076b200410a1804076ad72948ec043f48414 (diff)
downloadscummvm-rg350-1c86b35f2a81a909ddd00ff05c88eeb4e4a974a5.tar.gz
scummvm-rg350-1c86b35f2a81a909ddd00ff05c88eeb4e4a974a5.tar.bz2
scummvm-rg350-1c86b35f2a81a909ddd00ff05c88eeb4e4a974a5.zip
workaround for voc weakness
svn-id: r5517
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index c6f47ae9f4..d0f75d8124 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4876,7 +4876,17 @@ void SimonState::playVoc(File *sound_file, uint32 *offsets, uint sound, PlayingS
sound_file->read(&voc_block_hdr, sizeof(voc_block_hdr));
size = voc_block_hdr.size[0] + (voc_block_hdr.size[1] << 8) + (voc_block_hdr.size[2] << 16) - 2;
- uint32 samples_per_sec = 1000000L / (256L - (long)voc_block_hdr.sr);
+ uint32 samples_per_sec;
+
+ /* workaround for voc weakness */
+ if (voc_block_hdr.sr == 0xa6) {
+ samples_per_sec = 11025;
+ } else if (voc_block_hdr.sr == 0xd2) {
+ samples_per_sec = 22050;
+ } else {
+ samples_per_sec = 1000000L / (256L - (long)voc_block_hdr.sr);
+ warning("inexact sample rate used: %i", samples_per_sec);
+ }
byte *buffer = (byte *)malloc(size);
sound_file->read(buffer, size);