AST files contain PCM16 sound data. They're used in Super Mario Galaxy for musics, and possibly in other games.
They contain an header followed by a BLCK chunk.
All the data in those files are big-endian, except where mentioned.
All the offsets are absolute (from begining of file), except where mentioned.
All the sizes are in bytes, except where mentioned.
The header is 64 bytes long. Here's a description of it:
|0x0004||4||Size of the BLCK chunk|
|0x0010||4||Sampling rate in Hz (typically 0x7D00 = 32000 Hz)|
|0x0018||4||Loopstart position in samples, from beginning of BLCK chunk|
|0x001C||4||Unknown (typically same as entry 0x0014)|
|0x0020||4||Block size? (typically 0x2760)|
The BLCK chunk directly follows the AST header. It contains a 32-byte header, followed by the PCM16 sound data.
Here's a description of it:
(from begin- ning of BLCK chunk)
|0x0004||4||Block size? (typically 0x2760)|
WARNING: The PCM16 data is stored in BIG-ENDIAN! Don't forget to byteswap each sample you read or your sound will be pure junk!