+==========================================================================================+ |Jazz Jackrabbit Sound format: | +==========================================================================================+ Jazz Jackrabbit sounds are stored in the SOUNDS.00X files. SOUNDS.000 is used by the game as a 'base' file, when Jazz is playing levels the sounds in SOUNDS.00X are added to this. This is done by the header in SOUNDS.00X pointing to sounds in SOUNDS.000 (by using a special pointer) as well as having references to their own sounds. Thus SOUNDS.000 is the largest file, with other sound files often being little more than empty headers. Jazz reads sound files by first checking the file signature, then getting an address from the last 4 bytes of the file. This points to the sound list, which is read, pointing to the various sounds in the file. Sound list pointers come in two types, normal (Poitning to a sound in the file.) and negative (Pointing to a sound in SOUNDS.000) Raw sound data: This is exactly like a wave file, being composed of 'samples' much like those used in ProTracker Studio Module (PSM) music files. The data consists of 1-byte signed entries and also sometimes contains a sample header for the samples to be extracted back to the original files, but this is treated as sound data by Jazz and is unimportant. Oddly, for SOUNDS.001 and onwards (2,3,...) any sound over 15 that refers to SOUNDS.000 refers to it 346 bytes further along than it should. This appears to relate to the header structure somehow, but I don't know exactly. Also sound 15, if it refers to SOUNDS.000 will have the reference value of sound 15 in SOUNDS.000, *even if that sound is not the same as the sound that it refers to* ------------------------------------------------------------------------------- FILE STRUCTURE: 0 4 Filesig File signature, 'sfx' + $1A 4 ? Data Raw sound data ? 18x Snd lst Sound list entries, there are 32 of these ... .. . +288 4 Lst loc Sound list location in file ------------------------------------------------ Sound list entries: 0 12 Name Sound name, this is the name of the sound, used by levels and such to play the sound, padded with nulls. 12 4 Loc Sound location in sound file, data is read from here. If this value is larger than $7FFFFFFF then is the 'negative' of the value and refers to the location of a sound in SOUNDS.000 (Thus the first entry in most SOUNDS.00X is $FFFFFFFC, pointing to 4 in the .000 file.) 16 2 Len Sound length, in bytes. ------------------------------------------------ ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Sound data sample header (If present): 1 1 Start $01, start of header 2 13 Name Sample name 14 2 Spacer Word, $0005 16 2 Size Size of sample after header 18 10 Blank 28 4 Vol Sample volume 32 4 Pitch 36 40 Blank 76 4 End Header end 'SCR' + $00 -------------------------------------------------------------------------------