CSMP (File Format)

The .csmp file format seen in Retro Studios games past Metroid Prime 2, it's very similar in use to AGSC and contains sound affects. Where CSMP differs is the fact that it only contains one sound (usually, there may be a few outliers) and is broken up into obvious data chunks with easily identifiable sizes.

Header
What follows is the header found in Metroid Prime 3 and Donkey Kong Country Returns, Tropical Freeze's seems to be a bit different. The file can be read using a simple while loop, each chunk designates it's size

{|class="wikitable" !Offset !Size !Description }
 * 0x0
 * 4
 * Magic; Always 0x43534D50 ("CSMP")
 * 0x4
 * 4
 * Version; Always 1
 * Version; Always 1

Chunk
{|class="wikitable" !Offset !Size !Description }
 * 0x0
 * 4
 * ChunkType
 * 0x4
 * 4
 * ChunkSize (N)
 * 0x8+N
 * colspan=2|End of chunk (usually, subtract 4 when the chunk type is equal to 0x44415441 ("DATA"))
 * 0x8+N
 * colspan=2|End of chunk (usually, subtract 4 when the chunk type is equal to 0x44415441 ("DATA"))

Chunk Types
The known values for each chunk are as follows --INFO-- {|class="wikitable" !Offset !Size !Description } --PAD-- Padding, just seek ChunkSize bytes ahead
 * 0x0
 * 1
 * Unknown
 * 0x1
 * 1
 * Loop Flag
 * 0x2
 * 4
 * Unknown
 * 0x6
 * 2
 * Unknown
 * 0x8
 * 4
 * Volume
 * 0x8
 * 4
 * Volume
 * Volume

--DATA-- Refer to the DSP page for details.