Line 5: |
Line 5: |
| All the offsets are absolute (from beginning of file), except where mentioned.<br/> | | All the offsets are absolute (from beginning of file), except where mentioned.<br/> |
| All the sizes are in bytes, except where mentioned.<br/> | | All the sizes are in bytes, except where mentioned.<br/> |
| + | Each chunk is padded to a multiple of 0x20.<br/> |
| | | |
| === BRSTM header === | | === BRSTM header === |
Line 204: |
Line 205: |
| | 0x0030 | | | 0x0030 |
| | 4 | | | 4 |
− | | Bits per sample? (0x04 for 4-bit ADPCM) | + | | Bytes per entry in the ADPC table |
| |} | | |} |
| | | |
| ==== HEAD chunk part 2 ==== | | ==== HEAD chunk part 2 ==== |
| | | |
− | There are at least 2 known types of this part:
| + | ===== Header ===== |
− | | |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
− | ! Type | + | ! Offset |
− | ! Marker | + | ! Size |
| ! Description | | ! Description |
| |- | | |- |
| + | | 0x0000 |
| + | | 1 |
| + | | Number of tracks |
| + | |- |
| + | | 0x0001 |
| | 1 | | | 1 |
− | | 0x01000000 | + | | Track Description Type |
− | | Used in Super Smash Bros. Brawl
| |
| |- | | |- |
| + | | 0x0002 |
| | 2 | | | 2 |
− | | 0x01010000 | + | | Padding? (0x00) |
− | | Used in other games.
| |
| |} | | |} |
| | | |
− | ===== Header ===== | + | ===== Offset table ===== |
| + | The header contains one of this structure for each track |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
Line 234: |
Line 239: |
| |- | | |- |
| | 0x0000 | | | 0x0000 |
| + | | 1 |
| + | | 0x01 |
| + | |- |
| + | | 0x0001 |
| + | | 1 |
| + | | Track description type |
| + | |- |
| + | | 0x0002 |
| + | | 2 |
| + | | Padding? (0x00) |
| + | |- |
| + | | 0x0004 |
| | 4 | | | 4 |
− | | Marker | + | | Offset to track description |
| |} | | |} |
| | | |
− | ===== Offset table ===== | + | ===== Track Descriptions ===== |
− | The file contains one of this structure for each track
| + | There are at least 2 known types of track descriptions: |
| + | |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
− | ! Offset | + | ! Type |
− | ! Size
| |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0000 | + | | 0 |
− | | 4 | + | | Used in Super Smash Bros. Brawl |
− | | Marker
| |
| |- | | |- |
− | | 0x0004 | + | | 1 |
− | | 4 | + | | Used in other games. |
− | | Offset to track description
| |
| |} | | |} |
| | | |
− | ===== Track Description Type 1 ===== | + | The header contains one track description for each track |
− | The file contains one of this structure for each track
| + | |
| + | ====== Track Description Type 0 ====== |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
Line 280: |
Line 296: |
| |} | | |} |
| | | |
− | ===== Track Description Type 2 ===== | + | ====== Track Description Type 1 ====== |
− | The file contains one of this structure for each track
| |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
Line 340: |
Line 355: |
| | | |
| ===== Offset table ===== | | ===== Offset table ===== |
− | The file contains one of this structure for each channel | + | The header contains one of this structure for each channel |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
Line 357: |
Line 372: |
| | | |
| ===== ADPCM Channel Information ===== | | ===== ADPCM Channel Information ===== |
− | The file contains one of this structure for each channel. | + | The header contains one of this structure for each channel. |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
Line 386: |
Line 401: |
| | 0x002C | | | 0x002C |
| | 2 | | | 2 |
− | | History sample 1 | + | | History sample 1 (Sample - 1) |
| |- | | |- |
| | 0x002E | | | 0x002E |
| | 2 | | | 2 |
− | | History sample 2 | + | | History sample 2 (Sample - 2) |
| |- | | |- |
| | 0x0030 | | | 0x0030 |
| | 2 | | | 2 |
− | | Loop predictor/scale | + | | Loop predictor/scale<br/> |
| + | If BRSTM doesn't loop, these will be the same as the initial predictor/scale and history. |
| |- | | |- |
| | 0x0032 | | | 0x0032 |
| | 2 | | | 2 |
− | | Loop History sample 1 | + | | Loop History sample 1 (Sample - 1) |
| |- | | |- |
| | 0x0034 | | | 0x0034 |
| | 2 | | | 2 |
− | | Loop History sample 2 | + | | Loop History sample 2 (Sample - 2) |
| |- | | |- |
| | 0x0036 | | | 0x0036 |
Line 411: |
Line 427: |
| === ADPC chunk === | | === ADPC chunk === |
| | | |
− | The ADPC chunk is typically 1216 bytes long. | + | The ADPC chunk contains 2 PCM history samples per channel for every entry in the table.<br/> |
− | It seems to contain some other ADPCM table.
| + | The number of samples per entry is specified in the HEAD chunk.<br/> |
| + | Each entry in the table contains the final two samples from the preceding block.<br/> |
| + | The first entry in the table contains the history samples contained in part 3 of the HEAD chunk. |
| + | |
| + | ==== Header ==== |
| + | |
| + | {| class="wikitable" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0000 |
| + | | 4 |
| + | | "ADPC" (0x41445043) |
| + | |- |
| + | | 0x0004 |
| + | | 4 |
| + | | Length of entire ADPC section. |
| + | |} |
| + | |
| + | ==== ADPC table entry==== |
| + | The size of each entry is the channel count * 4 |
| + | {| class="wikitable" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0000 |
| + | | 2 |
| + | | Channel 0 History sample 1 |
| + | |- |
| + | | 0x0002 |
| + | | 2 |
| + | | Channel 0 History sample 2 |
| + | |- |
| + | | 0x0004 |
| + | | 2 |
| + | | Channel 1 History sample 1 |
| + | |- |
| + | | 0x0006 |
| + | | 2 |
| + | | Channel 1 History sample 2 |
| + | |- |
| + | | ... |
| + | | 2 |
| + | | Channel N History sample 1 |
| + | |- |
| + | | ... |
| + | | 2 |
| + | | Channel N History sample 2 |
| + | |} |
| | | |
| === DATA chunk === | | === DATA chunk === |
| | | |
| The DATA chunk contains ADPCM sound data. | | The DATA chunk contains ADPCM sound data. |
| + | |
| + | ==== Header ==== |
| + | {| class="wikitable" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0000 |
| + | | 4 |
| + | | "DATA" (0x44415441) |
| + | |- |
| + | | 0x0004 |
| + | | 4 |
| + | | Length of entire DATA section. |
| + | |- |
| + | | 0x0008 |
| + | | 4 |
| + | | Number of padding samples between header and ADPCM data? Always 0x18 |
| + | |- |
| + | | 0x000C |
| + | | 0x14 |
| + | | Padding (0x00) |
| + | |} |
| + | |
| + | ==== ADPCM Data ==== |
| + | The ADPCM audio data is interlaced per channel according to the block sizes specified in the header. |
| + | |
| + | {| class="wikitable" |
| + | |- |
| + | ! Description |
| + | ! Size |
| + | |- |
| + | | Channel 0 block 0 |
| + | | Block size |
| + | |- |
| + | | Channel 1 block 0 |
| + | | Block size |
| + | |- |
| + | | Channel 0 block 1 |
| + | | Block size |
| + | |- |
| + | | Channel 1 block 1 |
| + | | Block size |
| + | |- |
| + | | ... |
| + | | |
| + | |- |
| + | | Channel 0 final block |
| + | | Final block size |
| + | |- |
| + | | Channel 1 final block |
| + | | Final block size |
| + | |} |
| | | |
| [[Category:File formats]] | | [[Category:File formats]] |