Opened 20 years ago

Closed 20 years ago

Last modified 5 years ago

#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)

blop (551 bytes ) - added by SF/yokna 20 years ago.
patch
audiostream.patch (550 bytes ) - added by fingolfin 20 years ago.
Small tweak to audiostream.cpp

Download all attachments as: .zip

Change History (9)

by SF/yokna, 20 years ago

Attachment: blop added

patch

comment:1 by fingolfin, 20 years ago

Owner: set to fingolfin

comment:2 by fingolfin, 20 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).

by fingolfin, 20 years ago

Attachment: audiostream.patch added

Small tweak to audiostream.cpp

comment:3 by fingolfin, 20 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 SF/yokna, 20 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 fingolfin, 20 years ago

Resolution: fixed
Status: newclosed

comment:6 by fingolfin, 20 years ago

Fixed the issue plus some other indy3 problem (Venice music wasn't playing) in CVS.

comment:7 by digitall, 5 years ago

Component: Audio
Note: See TracTickets for help on using tickets.