Opened 13 years ago

Closed 13 years ago

Last modified 6 years ago

#9358 closed patch

Tools: Add raw audio support to compress_sci

Reported by: SF/agf863 Owned by: bluegr
Priority: normal Component: Tools
Version: Keywords:
Cc: Game:


KQ5CD uses a raw audio resource file that isn't currently supported by compress_sci.

To implement this, 1. Recognize this file by it's size -- mine is from the (second?) King's Quest Collection 2. Get resource count, offsets, and sizes from AUDIO001.MAP (in the same directory as the audio file) 3. Use this information instead of header information to compress the audio resources and build the offset translation table 4. Adjust file position to account for padding of sounds to 2048 bytes

I also trivially modified detectData() to improve memory allocation consistency for the different resource types.

I assume there are other versions of this file for KQ5 with other sizes (I think there are versions for other languages on one of my collection CDs), and there may be other games that use raw audio. Once this patch is added it's easy to add support for other raw files, just recognizing each by it's size and using that to set parameters which are different from this KQ5 file (different MAP format or different sound sample format).

Ticket imported from: #3302317. Ticket imported from: patches/1463.

Attachments (1)

compress_sci_raw_audio.patch (7.0 KB ) - added by SF/agf863 13 years ago.
Compress KQ5 & Jones in the Fast Lane raw audio files

Download all attachments as: .zip

Change History (7)

comment:1 by SF/agf863, 13 years ago

Updated patch to also support Jones in the Fast Lane raw audio file. This file is tiny (22mb uncompressed, 9mb compressed) but is the exact same format as the KQ5 file so there is no reason not to support it.

comment:2 by SF/agf863, 13 years ago

Summary: Tools: Add KQ5 raw audio support to compress_sciTools: Add raw audio support to compress_sci

by SF/agf863, 13 years ago

Compress KQ5 & Jones in the Fast Lane raw audio files

comment:3 by SF/agf863, 13 years ago

Fix an edge case: if a resource offset + resource size was a multiple of 2048 exactly, would pad out 2048 additional bytes instead of not padding at all.

Also avoid some unnecessary work if the file has been identified as a raw audio file.

comment:4 by bluegr, 13 years ago

An updated version of this patch has been submitted and accepted as a pull request:

Thanks again!

Closing this

comment:5 by bluegr, 13 years ago

Owner: set to bluegr
Status: newclosed

comment:6 by digitall, 6 years ago

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