BAS (File Format)
This page is in progress and may contain incomplete information or editor's notes. |
---|
BAS stands for (presumably) Binary Audio Sequence. It is used in several JSystem games, including Super Mario Galaxy and Super Mario Galaxy 2.
Header
Every BAS starts with this header. It is 0x8 in size.
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Entry Count |
0x02 | UInt16 | Unused |
0x04 | UInt32 * | Pointer (in memory) to a class that implements virtual methods for:
in that order. Put 0 for default behavior. Always 0 in SMG/SMG2. |
It is then followed by an array of sound entries:
Offset | Type | Description |
---|---|---|
0x08 | SoundEntry[Entry Count] | Array of sound entries. |
Sound Entry
0x20 in size, including padding.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Sound ID |
0x04 | Single | Start Frame |
0x08 | Single | End Frame |
0x0C | Single | Pitch |
0x10 | UInt32 | Flags:
bool useEndFrame(?) = (flags >> 6) & 0x01 |
0x14 | UInt8 | Volume |
0x15 | UInt8 | Pitch Factor |
0x16 | UInt8 | Loop Count |
0x17 | UInt8 | Panning |
0x18 | UInt8 | Volume Factor |
0x19 | UInt8[7] | Padding |
(References: Hack.io.BAS, bastool, pyjaubas)