BRSTM (File Format)
(Redirected from BRSTM)
Jump to navigation
Jump to search
Overview
This article describes the BRSTM format, which is the music format used by Mario Kart Wii and other games such as Super Smash Bros. Brawl.
File Header
The file begins with the header, which is 0x64 bytes. All lengths are written in hexadecimal.
Offset | Size | Description |
---|---|---|
0x00 | 4 | File magic. RSTM in ASCII. |
0x04 | 2 | Byte order mark (BOM): The value is always 0xFEFF. If value 0xFFFE is read, then the false endian is used. Mario Kart Wii uses nearly always big endian (bytes 0xFE,0xFF). |
0x06 | 2 | Unknown. Usually 01 00. |
0x08 | 4 | Length of the file in bytes. |
0x0c | 2 | Length of header in bytes (always 00 40). |
0x0e | 2 | Unknown. 00 02 in most files. |
0x10 | 4 | Offset location of the HEAD section (usually 00 00 00 40). |
0x14 | 4 | Size of HEAD section in bytes. |
0x18 | 4 | Offset location of ADPC section in bytes. |
0x1c | 4 | Size of ADPC section in bytes. |
0x20 | 4 | Offset location of DATA section in bytes. |
0x24 | 4 | Size of DATA section in bytes. |
0x28 | 18 | Unknown. Probably padding. |
End of header |
Sections
The rest of the file is written like an Adaptive differential pulse-code modulation (ADPCM) file.
HEAD
The HEAD section is typically 256 bytes long.
It contains what appears to be a ADPCM table, followed by a a YN1 & YN2 twice, which may control looping. The byte at 0x23 describes the number of channels. The rest is unknown.
ADPC
The ADPC section contains another type of table.
Offset | Size | Description |
---|---|---|
0x00 | 4 | Section magic. ADPC in ASCII. |
0x04 | 4 | Length of section in bytes (typically 00 00 21 60). |
0x08 | 2158 | Unknown. Most likely padding. |
End of section |
DATA
The DATA section contains the ADPCM data, the sounds the file makes.
Offset | Size | Description |
---|---|---|
0x00 | 4 | Section magic. DATA in ASCII. |
0x04 | 4 | Length of section in bytes (L = Section Length). |
0x08 | 4 | Unknown. Number of sub-sections in the ADPCM data? |
0x0b | 14 | Padding. |
0x20 | L | ADPCM data. |
0x30 + L | 0A | Padding. |
End of section | ||
End of file |