Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Gladius (2003, LucasArts) sound system
- ---
- (further information here is based on the Xbox version of the game)
- the sound system leverages at least three files:
- 1. "internal" file("XBB" extension)
- 2. "external" file("XSB" extension)
- 3. "flow" file("FLO" extension)
- "internal" file goes like this:
- 0x00(32-bit) - whole size of "internal" file minus 4
- 0x04(32-bit) - number of sound entries (explained later)
- so, what is "number of sound entries" doing here?
- first of all, "internal" file is home to "smaller" sounds that the game needs to use. that is to say, if at least one sound entry has a smaller file size (2MB for example) then that file is guaranteed to stay into that "internal" file. otherwise it belongs in the "external" file which is where some of the "larger" sound entries (11MB for example) reside.
- one thing both files ("internal" and "external") all have in common however is that these sound files need a header to prepare them for in-game decoding. the Xbox version of the game uses RIFF as the basis for such a header.
- for "smaller sounds" that are stored in this "internal" file they are stored into fully-formed RIFF files.
- for "larger sounds" that are stored in this "external" file, said "larger" sound is stored there without a RIFF header (as in, raw sound data). instead, the "internal" file carries up the RIFF header for that "larger" sound and the only thing that comes out after that point is two more infos for that particular sound.
- anyway, here's the rundown of how RIFF header looks like:
- 0x00(32-bit) - "RIFF" chunk
- 0x04(32-bit) - "RIFF" size, actual meaning depends on:
- 1. for "smaller sounds", whole size that comes after said chunk
- 2. for "larger sounds", 0x30
- 0x08(32-bit) - "WAVE" chunk
- 0x0c(32-bit) - "fmt " chunk
- 0x10(32-bit) - "fmt " size
- 0x14(16-bit) - codec number, always 0x69
- 0x16(16-bit) - channels
- 0x18(32-bit) - sample rate frequency
- 0x1c(32-bit) - average bytes per second
- 0x20(16-bit) - block size (includes all channels)
- 0x22(16-bit) - bit depth, always 4
- 0x24(16-bit) - always 2
- 0x26(16-bit) - always 0x40
- 0x28(32-bit) - "data" chunk
- 0x2c(32-bit) - "data" size actual meaning depends on:
- 1. for "smaller sounds", whole size that comes after said chunk
- 2. for "larger sounds", 0xfffffff8
- for "larger sounds", RIFF header has extra data after this:
- 0x30(32-bit) - sound offset
- 0x34(32-bit) - sound size
- for "smaller sounds" after RIFF header comes actual sound data.
- with all this in mind, the "internal" file includes not only includes "smaller" sound entries but also "larger" ones, and thus have entirely different ways of dealing with them.
- hence why "number of sound entries" is there to begin with.
- all sound entries use a proprietary ADPCM codec embedded as a decoder chip into the designed platform. in Gladius' case, the game was released into PlayStation 2, GameCube, and Xbox. from there on, the game will have all its sound files use that particular codec coming from these platforms. the Xbox version of the game uses the aforementioned RIFF header for most of its handiwork pertaining to all those sound entries that are going to be played in-game.
- as for the "flow" file, it acts as a "script" file for the sound system to process in-game sounds. for brevity sake, how the "flow" file works will not be explored here. at least not for now.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement