Format:BRSTM, BCSTM and BFSTM streams
| On this wiki | Facts · Code · Notes · Topics |
|---|
Nintendo's streamed audio containers: BRSTM (magic RSTM, Wii, big endian), BCSTM (CSTM, 3DS, little endian) and BFSTM (FSTM, Wii U big endian and Switch little endian), all with an INFO block (codec, channels, sample rate, loop points) and interleaved PCM8, PCM16 or DSP-ADPCM data.
Overview
The three formats store long music streams. BRSTM belongs to the Wii (NW4R sound), BCSTM to the 3DS and BFSTM to the Wii U and Switch. Field offsets are from vgmstream (ISC license; src/meta/brstm.c, bcstm.c, bfstm.c). Byte order is declared by the BOM at +4.
BRSTM
- 0x00
RSTM; 0x04 u16 BOM 0xFEFF (big endian in all Wii games); 0x06 u16 version (0x0100 in nearly all games, 0x0001 in some files with a simpler header, noted by vgmstream as the Trauma Center version (src/meta/brstm.c line 21, commit f7f764155b)); 0x08 u32 file size; 0x0C u16 header size; 0x0E u16 chunk count; 0x10 offset of the HEAD chunk. - HEAD chunk (
HEAD): the stream info is at HEAD+0x20: u8 codec (0 PCM8, 1 PCM16 big endian, 2 DSP ADPCM), u8 loop flag, u8 channel count, u16 sample rate at +0x04, u32 loop start sample at +0x08, u32 sample count at +0x0C, u32 data start offset at +0x10, u32 interleave block size at +0x18, u32 last block size at +0x28. DSP coefficients are reached through the HEAD offset tables (16 s16 coefficients per channel); the exact lookup is in Fact:BRSTM, BCSTM and BFSTM streams/behavior/BRSTM DSP coefficient lookup and the decoder in Format:GameCube DSP ADPCM.
BCSTM and BFSTM
Both start with CSTM or FSTM, a u16 BOM at +4 (for FSTM 0xFEFF read as big endian means Wii U, 0xFFFE means Switch little endian), header size 0x40 and version 0x00000400 at +0x08. A section table starts at +0x10: u16 count, then entries at +0x14 of 0x0C bytes (u16 id, padding, u32 offset, u32 size): 0x4000 INFO, 0x4001 SEEK, 0x4002 DATA, 0x4003 REGN (regions), 0x4004 PDAT (prefetch data). In INFO: u8 codec at +0x20 (0 PCM8, 1 PCM16, 2 DSP ADPCM, 3 IMA ADPCM), u8 loop flag, u8 channels, u8 region count (FSTM), u32 sample rate at +0x24, u32 loop start at +0x28, u32 sample count at +0x2C, u32 interleave block size at +0x34, last block size at +0x44. Audio starts at DATA offset + 0x20. DSP coefficients are found through the channel info tables referenced from INFO+0x1C. Games from Camelot are noted by vgmstream to hijack the codec field in 3DS files.
zeldamods/oead (GPL-2.0-or-later) also ships header readers for FSTM/FSTP/FWAV (src/fstm.cpp, fstp.cpp, fwav.cpp), not read here.
Related
Platform:Nintendo Wii, Platform:Nintendo Switch.
Code & repositories
- https://github.com/vgmstream/vgmstream @
db77f98f405a45ad08df98aa444cae3848f95e6c· license: ISC (declared by the contributor; GitHub's detector did not recognize COPYING)
Audio stream decoder library; src/meta/brstm.c, bcstm.c, bfstm.c and bfwav.c document the RSTM/CSTM/FSTM headers and their codec ids
Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries