#8303 closed patch (fixed)
Sound mistake
Reported by: | SF/yokna | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Audio |
Version: | Keywords: | ||
Cc: | Game: |
Description
small patch to correct a mistake in audiostream.cpp
if loopLen is the length of the loop, then the sound pointer must go from 0 to loopLen - 1, hence the -1 in the definition of loopEnd.
It fixes a sound glitch in Indiana Jones 3 (fmTowns version)
Ticket imported from: #853485. Ticket imported from: patches/408.
Attachments (2)
Change History (9)
by , 21 years ago
comment:1 by , 21 years ago
Owner: | set to |
---|
comment:2 by , 21 years ago
I am not convinced that this patch is correct. There may be a bug, but the end marker is supposed to be exactly one byte beyond the last valid data byte of the stream. Maybe some check for the end marker is invalid, but then we should fix that.
Alas, it's past midnight, I had a very long day and can't think straight, maybe I am wrong. I'll look into this once i got some more time/sleep (tomorrow or weekend).
comment:3 by , 21 years ago
Yup your change definitely is wrong. Maybe the code which calls it has a bug, or whatever. There is one small tweak (see attached patch) which I will make to CVS now, though I don't quite see how it would fix whatever bug you are seeing.
Please tell me where exactly I can reproduce the sound glitch so I can look into it myself. Thanks!
comment:4 by , 21 years ago
The sound glitch occurs exactly during the introduction, while indy jumps over the train. Anyway, you were right, the bug is not related to audiostream.cpp.
In fact, the sound that is played is filled in scumm/sound.cpp (circa line 300) waveSize = loopEnd = 6549 , loopStart = 0
I found that the last bit in the buffer (called sound) is
sound[6548] = 255 (bit = 255)
whereas the preceding values are
sound[6543 to 6547] = 107, 110, 114, 117, 119
(that is bit = 20, 17, 13, 10, 8)
This 255 seems rather disturbing..
(last CVS, Indy3 fmTowns)
comment:5 by , 21 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 by , 21 years ago
Fixed the issue plus some other indy3 problem (Venice music wasn't playing) in CVS.
comment:7 by , 6 years ago
Component: | → Audio |
---|
patch