BAS (File Format)
BAS (Binary Animation Sound) files play Sound Effects when a defined frame of a BCK animation is reached. They only work with a BCK file of the same filename. Super Mario Galaxy and Super Mario Galaxy 2 each contain BAS files in many ObjectData files.
File specifications
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)