Difference between revisions of "SND"
Jump to navigation
Jump to search
(Transferred initial notes from GitHub) |
|||
Line 4: | Line 4: | ||
[[Category:Music]] | [[Category:Music]] | ||
The SND file, also known as DTPK, is used for both sequenced music and packages of sound effects.<br> | The SND file, also known as DTPK, is used for both sequenced music and packages of sound effects.<br> | ||
The format is played back via the AM2 AICA driver, located as AICADRV.BIN in the MISC folder on the Dreamcast versions of the game. This driver is loaded right into the start of AICA RAM at 0. The driver always loads the SND file for music into the hard-coded offset of 0x10000. Subsequent files can be loaded | The format is played back via the AM2 AICA driver, located as AICADRV.BIN in the MISC folder on the Dreamcast versions of the game. This driver is loaded right into the start of AICA RAM at 0. The driver always loads the SND file for music into the hard-coded offset of 0x10000. Subsequent files can be loaded after that, the offset(s) written to a table found at 0xDB00 with 0x20 byte entries per file. The second file offset is at 0xDB20, the third at 0xDB40, etc. This loaded file table will be further documented later. | ||
SND File format | SND File format |
Revision as of 04:17, 19 March 2021
The SND file, also known as DTPK, is used for both sequenced music and packages of sound effects.
The format is played back via the AM2 AICA driver, located as AICADRV.BIN in the MISC folder on the Dreamcast versions of the game. This driver is loaded right into the start of AICA RAM at 0. The driver always loads the SND file for music into the hard-coded offset of 0x10000. Subsequent files can be loaded after that, the offset(s) written to a table found at 0xDB00 with 0x20 byte entries per file. The second file offset is at 0xDB20, the third at 0xDB40, etc. This loaded file table will be further documented later.
SND File format
Header
Position | Length | Type | Description |
---|---|---|---|
0x00 | 0x04 | string | Identifier 0x4454504B (DTPK) |
0x08 | 0x04 | uint | Size of file |
0x3C | 0x04 | uint | Location of Sample Table |
Sample Table
Position | Length | Type | Description |
---|---|---|---|
0x00 | 0x04 | uint | Index of last sample (Add 1 for number of samples) |
0x04 | N/A | N/A | First sample entry (0x10 bytes each) |
Sample Entries
Position | Length | Type | Description |
---|---|---|---|
0x00 | 0x04 | uint | Sample Location & Type packed as follows: |
& 0x007FFFFF | Sample Offset | ||
& 0x00800000 | Sample quality. 0 Normal, 1 Half | ||
& 0x01000000 | Format flag - 0 PCM, 1 ADPCM | ||
& 0x02000000 | Unknown flag. Is NOT Mono/Stereo | ||
0x04 | 0x2 | ushort | Loop start offset from start of sample |
0x06 | 0x2 | ushort | Loop end offset from start of sample |
0x08 | 0x4 | uint | Related to sample frequency. Either 0 or 0x80. 0x80 = Half sample rate |
0x0C | 0xC | uint | Size of sample data |
AICA Driver Commands TBD