BCWAV: Difference between revisions
Jump to navigation
Jump to search
Einstein95 (talk | contribs) |
Steveice10 (talk | contribs) mNo edit summary |
||
| Line 20: | Line 20: | ||
| 0x004 || 2 || Endianness (0xFEFF = little, 0xFFFE = big) | | 0x004 || 2 || Endianness (0xFEFF = little, 0xFFFE = big) | ||
|- | |- | ||
| 0x006 || 2 || Header Size (0x40) | | 0x006 || 2 || Header Size (0x40 due to [[BCWAV#Info Block|Info Block]] alignment) | ||
|- | |- | ||
| 0x008 || 4 || Version (0x02010000) | | 0x008 || 4 || Version (0x02010000) | ||
| Line 33: | Line 33: | ||
|- | |- | ||
| 0x020 || 12 || [[BCWAV#Data Block|Data Block]] [[BCWAV#Sized Reference|Sized Reference]] (Offset relative to start of file) | | 0x020 || 12 || [[BCWAV#Data Block|Data Block]] [[BCWAV#Sized Reference|Sized Reference]] (Offset relative to start of file) | ||
|} | |} | ||
| Line 83: | Line 81: | ||
| 0x01C || 4 + Count * 8 || [[BCWAV#Channel Info|Channel Info]] [[BCWAV#Reference Table|Reference Table]] | | 0x01C || 4 + Count * 8 || [[BCWAV#Channel Info|Channel Info]] [[BCWAV#Reference Table|Reference Table]] | ||
|} | |} | ||
The info block is aligned to 0x20 bytes. | |||
=== Data Block === | === Data Block === | ||
| Line 94: | Line 94: | ||
| 0x008 || [[BCWAV#Block Header|Block Header]] Size - 8 || Data | | 0x008 || [[BCWAV#Block Header|Block Header]] Size - 8 || Data | ||
|} | |} | ||
The data block is aligned to 0x20 bytes, as well as the data field's actual sample data. | |||
=== Encoding === | === Encoding === | ||
| Line 134: | Line 136: | ||
|- | |- | ||
| 0x026 || 6 || Loop [[BCWAV#DSP ADPCM Context|Context]] | | 0x026 || 6 || Loop [[BCWAV#DSP ADPCM Context|Context]] | ||
|- | |||
| 0x02C || 2 || Padding | |||
|} | |} | ||
Revision as of 03:00, 10 December 2015
This document is about the format of Banner's CTR Wave files (BCWAV).
The structure is very similar to Microsoft's Wave file.
Banner CWAV total channels must be 2, and the length of the audio in seconds must be 3 seconds or less.
Overview
Microsoft's WAV structure is RIFF Header which defines the data inside which is WAVE, then the media player expects a "fmt " chunk and a "data" chunk. Nintendo's format uses a CWAV header (no need for a general structure for media, only wave), which points to an INFO struct (the equivalent to fmt) and a DATA struct (the equivalent to data).
Header
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 4 | Magic (CWAV) |
| 0x004 | 2 | Endianness (0xFEFF = little, 0xFFFE = big) |
| 0x006 | 2 | Header Size (0x40 due to Info Block alignment) |
| 0x008 | 4 | Version (0x02010000) |
| 0x00C | 4 | File Size |
| 0x010 | 2 | Number of Blocks (2) |
| 0x012 | 2 | Reserved |
| 0x014 | 12 | Info Block Sized Reference (Offset relative to start of file) |
| 0x020 | 12 | Data Block Sized Reference (Offset relative to start of file) |
Block Header
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 4 | Magic |
| 0x004 | 4 | Size |
Block Types
| MAGIC | TYPE |
|---|---|
| INFO | Info Block |
| DATA | Data Block |
Info Block
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 8 | Block Header |
| 0x008 | 1 | Encoding |
| 0x009 | 1 | Loop (0 = don't loop, 1 = loop) |
| 0x00A | 2 | Padding |
| 0x00C | 4 | Sample Rate |
| 0x010 | 4 | Loop Start Frame |
| 0x014 | 4 | Loop End Frame |
| 0x018 | 4 | Reserved |
| 0x01C | 4 + Count * 8 | Channel Info Reference Table |
The info block is aligned to 0x20 bytes.
Data Block
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 8 | Block Header |
| 0x008 | Block Header Size - 8 | Data |
The data block is aligned to 0x20 bytes, as well as the data field's actual sample data.
Encoding
| VALUE | DESCRIPTION |
|---|---|
| 0 | PCM8 |
| 1 | PCM16 |
| 2 | DSP ADPCM |
| 3 | IMA ADPCM |
Channel Info
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 8 | Samples Reference (Offset relative to Data Block Data field) |
| 0x008 | 8 | ADPCM Info Reference (Offset relative to Channel Info start) |
| 0x010 | 4 | Reserved |
DSP ADPCM Info
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 32 | Param |
| 0x020 | 6 | Context |
| 0x026 | 6 | Loop Context |
| 0x02C | 2 | Padding |
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
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 4 | Context |
| 0x004 | 4 | Loop Context |
IMA ADPCM Context
| OFFSET | SIZE | DESCRIPTION |
|---|---|---|
| 0x000 | 2 | Data |
| 0x002 | 1 | Table Index |
| 0x003 | 1 | Padding |
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
| ID | TYPE |
|---|---|
| 0x0300 | DSP ADPCM Info |
| 0x0301 | IMA ADPCM Info |
| 0x1F00 | Sample Data |
| 0x7000 | Info Block |
| 0x7001 | Data Block |
| 0x7100 | Channel Info |