This document is about the format of CTR Streams (CSTM).
Overview
#
The structure is similar to that of a
BCWAV, with a
few differences, such as its different INFO block format, the addition
of a SEEK block, and the organization of the DATA block samples into
blocks.
These files are either found in rom:\sound\stream\ or they can be
inside of a CSAR.
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 4 | Magic |
0x004 | 4 | Size |
Block Types
#
Info Block
#
If encoding is DSP ADPCM:
If encoding is IMA ADPCM:
The info block is aligned to 0x20 bytes.
Encoding
#
VALUE | DESCRIPTION |
---|
0 | PCM8 |
1 | PCM16 |
2 | DSP ADPCM |
3 | IMA ADPCM |
Stream Info
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 1 | Encoding |
0x001 | 1 | Loop (0 = don’t loop, 1 = loop) |
0x002 | 1 | Channel Count |
0x003 | 1 | Padding |
0x004 | 4 | Sample Rate |
0x008 | 4 | Loop Start Frame |
0x00C | 4 | Loop End Frame |
0x010 | 4 | Sample Block Count |
0x014 | 4 | Sample Block Size |
0x018 | 4 | Sample Block Sample Count |
0x01C | 4 | Last Sample Block Size |
0x020 | 4 | Last Sample Block Sample Count |
0x024 | 4 | Last Sample Block Padded Size |
0x028 | 4 | Seek Data Size |
0x02C | 4 | Seek Interval Sample Count |
0x030 | 8 | Sample Data
Reference (Offset relative to
Data Block Data field) |
Track Info
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 1 | Volume |
0x001 | 1 | Pan |
0x002 | 2 | Padding |
0x004 | 8 | Channel Index
Byte Table
Reference (Offset relative to Volume field) |
0x00C | X | Channel Index
Byte Table (Padded to 4 bytes) |
Byte Table
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 4 | Count |
0x004 | Count | Elements |
Channel Info
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 8 | ADPCM Info
Reference (Offset relative to this field) |
DSP ADPCM Info
#
DSP ADPCM Param
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 32 | 16-bit Coefficients |
DSP ADPCM Context
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 1 | 4-bit Predictor + 4-bit Scale |
0x001 | 1 | Reserved |
0x002 | 2 | Previous Sample |
0x004 | 2 | Second Previous Sample |
IMA ADPCM Info
#
IMA ADPCM Context
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 2 | Data |
0x002 | 1 | Table Index |
0x003 | 1 | Padding |
Seek Block
#
The seek block is aligned to 0x20 bytes.
Data Block
#
The data block is aligned to 0x20 bytes, as well as the data field’s
actual sample data.
Reference Table
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 4 | Count |
0x004 | Count * 8 | References (Offsets relative to Count field) |
Sized Reference
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 8 | Reference |
0x008 | 4 | Size |
Reference
#
OFFSET | SIZE | DESCRIPTION |
---|
0x000 | 2 | Type ID |
0x002 | 2 | Padding |
0x004 | 4 | Offset (“null” = 0xFFFFFFFF) |
Reference Types
#
The following tools can play BCSTMs and convert them to other formats:
Category:File formats