BRSTM (File Format)
Revision as of 16:42, 27 November 2012 by SuperMario64DS (talk | contribs) (Created page with "This article describes the '''BRSTM''' format, the music format used by Mario Kart Wii, '''Super Smash Bros. Brawl''', and many others. == File Header == The file begins wi...")
This article describes the BRSTM format, the music format used by Mario Kart Wii, Super Smash Bros. Brawl, and many others.
File Header
The file begins with the header, which is 0x64 bytes. All lengths are written in Decimal.
Offset | Size | Description | |||
---|---|---|---|---|---|
0x00 | 4 | File identifier: 'RSTM' in ASCII. | |||
0x04 | 2 | Byte order mark. 0xFEFF is the big endian byte order, 0xFFFE is little endian. | |||
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 | 24 | Unknwon (Consists of only 00) | |||
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 rest is unknown.
ADPC
The ADPC section contains what looks like another table. All lengths are written in decimal.
Offset | Size | Description | |||
---|---|---|---|---|---|
0x00 | 4 | Section header: 'ADPC' in ASCII. | |||
0x04 | 4 | Length of section in bytes (Typically 00 00 21 60) | |||
0x08 | 1216 | Null bytes (00) | |||
End of section |
DATA
The DATA section contains the ADPCM data, the sounds the file make. All lengths are written in hexadecimal.
Offset | Size | Description | |||
---|---|---|---|---|---|
0x00 | 4 | Section header: '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/Null Bytes | |||
0x20 | L | ADPCM Data | |||
0x30 + L | 10 | Padding | |||
End of section | |||||
End of file |