fact chunk
The fact chunk gives the length of the audio in sample frames. For PCM the
length follows from the data size, but for compressed audio it does not, so the original
RIFF specification requires a fact chunk in every WAV file that is not
PCM.
Fields
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | char[4] | ckID | fact |
| 4 | 4 | u32 | ckSize | 4, sometimes more |
| 8 | 4 | u32 | dwSampleLength | the number of sample frames per channel |
00000000 66 61 63 74 04 00 00 00 44 AC 00 00 fact....D...
When it appears
- ADPCM, µ-law, A-law, GSM and MP3 data in a WAV file: required by the original specification, and used by players to show the length.
- Floating point and extensible files: many writers add one, and some readers expect it.
- Integer PCM: optional, since the frame count is the data size divided by the block align.
In an RF64 file a count too large for
32 bits is written as 0xFFFFFFFF, and the real value is the
sampleCount field of the ds64 chunk.