CSW (File Format)

From Luma's Workshop
Jump to navigation Jump to search


CSW (Controller Speaker Wave) files contain sound data that is played through the Wii Remote Speaker. They are linked to BCT files. Super Mario Galaxy and Super Mario Galaxy 2 each contain only one CSW file, located in AudioRes/SpkRes/SpkRes.arc/bin/spkwave.csw.

File specifications

CSW files don't seem to contain a header. Instead they directly start with a table.

Sound offset table

Offset Type Description
0x0 UInt32 (0x4) Size of the file in bytes
0x4 UInt32 (0x4) Amount of sounds
0x8 + N * 4 UInt32 (0x4) Offset to sound data

The rest of the section is padded to the nearest 0x20.

Sound data

Offset Type Description
0x0 UInt32 (0x4) Size of wave data in bytes
0x4 UInt32 (0x4) Loop start in samples, 0xFFFF when no loop
0x8 UInt32 (0x4) Loop end in samples, 0xFFFF when no loop
0xC Wave data

The rest of the file is padded to the nearest 0x20.

Unused Speaker Sounds

The following Speaker Sounds are not referenced in game code and thus remain unused. Note that Speaker Sounds referenced in code can also end up unused, but those are more difficult to research.

Super Mario Galaxy

CS_DPD_B_RELEASE
CS_DPD_B_TRG
CS_DPD_POINT
CS_DPD_SIGN
CS_GET_POWER
CS_NOTICE_BUTTON
CS_PRESSED_BUTTON
CS_STARDUST_CHARGE
CS_TENNIS
CS_TEST_SIN_600HZ
CS_VOLUME_CONFIG

Super Mario Galaxy 2

CS_CAN_PLAY_2P
CS_DPD_POINT
CS_IN_DISPLAY_2P
CS_OUT_DISPLAY_2P
CS_PRESSED_BUTTON
CS_YOSHI_PULL