Opened 16 years ago

Closed 16 years ago

Last modified 8 months ago

#8303 closed patch (fixed)

Sound mistake

Reported by: SF/yokna Owned by: fingolfin
Priority: normal Component: Audio
Keywords: Cc:


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 16 years ago.
audiostream.patch (550 bytes) - added by fingolfin 16 years ago.
Small tweak to audiostream.cpp

Download all attachments as: .zip

Change History (9)

Changed 16 years ago by SF/yokna

Attachment: blop added


comment:1 Changed 16 years ago by fingolfin

Owner: set to fingolfin

comment:2 Changed 16 years ago by fingolfin

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

Changed 16 years ago by fingolfin

Attachment: audiostream.patch added

Small tweak to audiostream.cpp

comment:3 Changed 16 years ago by fingolfin

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 Changed 16 years ago by SF/yokna

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 Changed 16 years ago by fingolfin

Resolution: fixed
Status: newclosed

comment:6 Changed 16 years ago by fingolfin

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

comment:7 Changed 8 months ago by digitall

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