The audio itself is described and stored as in a WAV file. Only the chunk headers around these structures are Wave64’s own; see Chunks.
fmt chunk
The chunk’s data is Microsoft’s WAVEFORMATEX structure, as in a WAV file.
The first six fields are always present; the rest depend on the format.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | wFormatTag | the format code; 1 is integer PCM and 3 IEEE float. The full list is on the WAV format codes page |
| 2 | 2 | u16 | nChannels | the number of channels |
| 4 | 4 | u32 | nSamplesPerSec | the sample rate in hertz |
| 8 | 4 | u32 | nAvgBytesPerSec | bytes per second of audio |
| 12 | 2 | u16 | nBlockAlign | the size of one sample frame in bytes |
| 14 | 2 | u16 | wBitsPerSample | bits per sample |
| 16 | 2 | u16 | cbSize | the number of extra bytes that follow, in the extended form |
| 18 | cbSize | bytes | extra format data |
Because the chunk’s size includes the 24-byte header, a chunk with the plain 16-byte structure has a size of 40. libsndfile pads this chunk with zeros so that the next chunk starts on a multiple of 8.
fact chunk
Eight bytes: a little-endian u64 frame count. The whole chunk is 32 bytes,
header included. As in WAV, it matters for compressed formats.
data chunk
The samples, laid out as in a WAV file: interleaved by channel, little-endian for integer and float formats, and blocks of the format’s own shape for compressed ones. The size of the chunk is 24 plus the number of bytes of audio. FFmpeg and libsndfile do not pad the end of this chunk.
Order of chunks
Public descriptions do not set a required order. Writers put fmt first
after the wave form type, and fact before data;
readers that can seek find the chunks by GUID.