Opened 20 years ago
Closed 20 years ago
Last modified 4 years ago
#928 closed defect (fixed)
ZAK256: Audio CD not handled properly
|Reported by:||SF/hibernatus||Owned by:||fingolfin|
Here is the format of an audio track sound: First of all, the byte at 0xD tells you it's an audio track (2). Nicer than testing the size.
The specific data starts at 0x16: byte: track number byte: number of times you play the track. byte: start (to cut the beginning of a song) byte: end
Here is how to read the start/end time: value = (time * 60 + time) * 75 + time; value is in 75ths of seconds (which means time is in minutes and time is in seconds).
About the number of times to play: 0xFF means infinite 0 means "play once" 1 means "play twice", etc.
But i think it was a bug because there are only 2 sounds which aren't looped infinitely (intro tune, and boom box tune by Razor and the Scummettes), and both of them are played twice while we'd logically expect them to be played once. I think the author thought 1 meant "play once".
Ticket imported from: #762593. Ticket imported from: bugs/928.
Change History (8)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
It works but there's a bug. To test it: In 49.LFL at 0xA6FE, enter: 01 00 00 01 0A 00 for example (which means play from 1m00s to 1m10s). Now launch the game and listen to the intro music. First, the beginning will be cut but not the end, and then you'll hear a strange loop (wait a little, because there is an 8sec silence at the end of the track). I tried with mp3 only, not CD.
About the "play once" thing: i was wrong, i've just checked and zak.exp does play once when it reads 1. I just got fooled by a script "bug" which plays the intro music twice (and of course you never heard the 2nd time unless the music is shortened).
comment:3 by , 20 years ago
Actually after looking at the data Zak256 gives us, the second value is *not* the endframe, rather it's the *length* of the data to play! So you'r example tesll it to play from 1m00s till 2m10s.
comment:4 by , 20 years ago
I'm sorry (because you seemed happy in the cvs comment :), but it's the end, not the length. At least in Zak. I've just tried with Unz from 01 00 00 to 01 01 00 and it lasts 1 second. My example was good too.
comment:5 by , 20 years ago
Sorry I was confused, and looking at LoomCD, somehow assuming that's the same but it's not, and I just fixed a long standing "problem": we called the two params for our CD playback methods "startFrame" and "endFrame", but they really are "startFrame" and "duration" - and that's the values we pass for all games. Except for Zak256, where we pass the endFrame. So I just made that "endFrame - startFrame". I hope that'll fix this bug.
comment:6 by , 20 years ago
Ah i see, somebody named the variable badly. I suggest some hard punishment for that one :) And yes, now the bug is gone, thanks a lot. I think you can close this bug report.
comment:7 by , 20 years ago
|Status:||new → closed|
comment:8 by , 4 years ago
|Component:||→ Engine: SCUMM|
|Game:||→ Zak McKracken|
I implemented the changes you suggest here in CVS. Please confirm if it helps once anon CVS has the changes (which might take up to 3 days :-/)