Skip to content

File Format: MUL

SalsaGal edited this page Mar 31, 2024 · 1 revision

mul is a proprietary format developed by Crystal Dynamics. Its purpose is to store multiple data streams of different types at the same time. It achieves this with multiplexing, which is where the extension comes from, and is used in games developed from 2003 to 2007.

There may be more accurate and exhaustive documentation, but here are the basics.

Header

After loading the important parts of the header, skip to offset 0x800 to find the first chunk of the multiplexed file.

Note that no magic number is specified.

Name Type Endianness
Audio stream sample rate Unsigned 32 bit integer Little
Unknown Signed 32 bit integer Little
Unknown 32 bit float Little
Audio stream channels Unsigned 32 bit integer Little

Chunk Header

There are three known chunk types, with a number associated to them:

  1. Audio contents (if this is the case, there is a subheader)
  2. Data (eg animations, models, textures, subtitles, cinematic sequences)
  3. Padding
Name Type Endianness
Chunk type Unsigned 32 bit integer Little
Chunk body size Unsigned 32 bit integer Little
Unknown Signed 32 bit integer Little
Unknown Signed 32 bit integer Little

Chunk Sub-Header

The actual size of the body of an audio chunk is stored in its sub-header. Because the sub-header is 16 bytes wide, the actual body size will always be 16 bytes less than the value specified earlier.

Name Type Endianness
Unknown Signed 32 bit integer Little
Actual audio chunk body size Unsigned 32 bit integer Little
Unknown Signed 32 bit integer Little
Unknown Signed 32 bit integer Little

Depending on how many channels the audio stream has, it may need to be interleaved/split. If the number of channels is equal to 1 (mono), then no interleave is needed. Otherwise the body has to be even;y interleaved, with the interleave size being the body size divided by the number of channels. Example:

Body size = 8000
Channels = 2

4000 bytes Left channel
4000 bytes right channel

===

Body size = 8000
channels = 8

1000 bytes channel 00
1000 bytes channel 01
1000 bytes channel 02
1000 bytes channel 03
1000 bytes channel 04
1000 bytes channel 05
1000 bytes channel 06
1000 bytes channel 07

Depending on the version of a Crystal Dynamics game the mul file has been extracted from, the audio is going to use a different codec:

  • PlayStation 2: Raw headerless vag audio (SONY_4BIT_ADPCM)
  • PC and XBox: Raw headerless XBox IMA ADPCM, often with block alignment equal to 36

Regular 16-bit PCM may also be used in some cases, but is yet to be determined.

Chunks continue until the last one is reached at the end of the file.

Clone this wiki locally