Difference between revisions of "BCSTM"
(→Format) |
|||
Line 12: | Line 12: | ||
=== Format === | === Format === | ||
− | + | === CSTM Header === | |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 19: | Line 19: | ||
|- | |- | ||
| 0x000 || 4 || MAGIC "CSTM" | | 0x000 || 4 || MAGIC "CSTM" | ||
+ | |} | ||
+ | |||
+ | === INFO Header === | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
|- | |- | ||
+ | ! OFFSET !! SIZE !! DESCRIPTION | ||
+ | |- | ||
+ | | 0x000 || 4 || Magic "INFO" | ||
+ | |- | ||
+ | | 0x004 || 4 || Length | ||
+ | |- | ||
+ | | 0x020 || 1 || Type (00 = PCM8, 01 = PCM16, 02 = DSPADPCM) | ||
+ | |- | ||
+ | | 0x021 || 1 || Loop Flag | ||
+ | |- | ||
+ | | 0x022 || 2 || Total Channels | ||
+ | |- | ||
+ | | 0x024 || 4 || Sample Rate | ||
+ | |- | ||
+ | | 0x028 || 4 || Unknown | ||
+ | |- | ||
+ | | 0x02C || 4 || Total samples | ||
+ | |- | ||
+ | | 0x030 || X || The Channels' Data Pointers | ||
+ | |- | ||
+ | | X || X || The Channels' Data | ||
+ | |} | ||
+ | |||
+ | === DATA Header === | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! OFFSET !! SIZE !! DESCRIPTION | ||
+ | |- | ||
+ | | 0x000 || 4 || Magic "DATA" | ||
+ | |- | ||
+ | | 0x004 || 4 || Length | ||
+ | |- | ||
+ | | 0x020 || X || Start of Channel Data | ||
|} | |} | ||
+ | |||
+ | Unlike CWAV, if there are 2 channels in a CSTM they alternate every 0x2000 bytes of the DATA partition starting at 0x20. | ||
Additionally it introduces a new partition called SEEK which comes right before DATA, so a CSTM would be ordered like this: | Additionally it introduces a new partition called SEEK which comes right before DATA, so a CSTM would be ordered like this: | ||
Line 29: | Line 70: | ||
* DATA Partition | * DATA Partition | ||
− | By default this means that 0x24-0x2B in the CSTM Partition is the SEEK position and length respectively, and DATA position and length follows it | + | By default this means that 0x24-0x2B in the CSTM Partition is the SEEK position and length respectively, and DATA position and length follows it (in a CWAV 0x24-0x2B is usually the DATA position and length). |
=== SEEK === | === SEEK === |
Revision as of 09:52, 5 January 2015
This document is about the format of CTR Streams (CSTM).
The structure is almost exact to the CTR Wave Format (CWAV).
Overview
The structure of the CSTM is almost exactly the CWAV, except a few differences. The formats can be easily converted between eachother.
These files are either found in rom:\sound\stream\ or they can be inside of a CSAR.
Format
CSTM Header
OFFSET | SIZE | DESCRIPTION |
---|---|---|
0x000 | 4 | MAGIC "CSTM" |
INFO Header
OFFSET | SIZE | DESCRIPTION |
---|---|---|
0x000 | 4 | Magic "INFO" |
0x004 | 4 | Length |
0x020 | 1 | Type (00 = PCM8, 01 = PCM16, 02 = DSPADPCM) |
0x021 | 1 | Loop Flag |
0x022 | 2 | Total Channels |
0x024 | 4 | Sample Rate |
0x028 | 4 | Unknown |
0x02C | 4 | Total samples |
0x030 | X | The Channels' Data Pointers |
X | X | The Channels' Data |
DATA Header
OFFSET | SIZE | DESCRIPTION |
---|---|---|
0x000 | 4 | Magic "DATA" |
0x004 | 4 | Length |
0x020 | X | Start of Channel Data |
Unlike CWAV, if there are 2 channels in a CSTM they alternate every 0x2000 bytes of the DATA partition starting at 0x20.
Additionally it introduces a new partition called SEEK which comes right before DATA, so a CSTM would be ordered like this:
- CSTM Header
- INFO Partition
- SEEK Partition
- DATA Partition
By default this means that 0x24-0x2B in the CSTM Partition is the SEEK position and length respectively, and DATA position and length follows it (in a CWAV 0x24-0x2B is usually the DATA position and length).
SEEK
OFFSET | SIZE | DESCRIPTION |
---|---|---|
0x000 | 4 | Magic (SEEK) |
0x004 | 4 | Length |