STREAMINFO is block type 0. It is always the first metadata block and there is exactly one. Its body is always 34 bytes, and it says what every frame needs to know about the stream.
Fields
| Bits | Field | Meaning |
|---|---|---|
| 16 | Minimum block size | Smallest block, in samples, 16 to 65535. The last frame may be shorter and does not count |
| 16 | Maximum block size | Largest block, in samples, 16 to 65535. Equal to the minimum in a fixed-blocksize stream |
| 24 | Minimum frame size | Smallest frame in bytes; 0 means not known |
| 24 | Maximum frame size | Largest frame in bytes; 0 means not known |
| 20 | Sample rate | In hertz. Must not be 0 when the stream has audio |
| 3 | Channels minus 1 | 1 to 8 channels |
| 5 | Bits per sample minus 1 | 4 to 32 bits |
| 36 | Total samples | Samples per channel in the stream; 0 means not known |
| 128 | MD5 | The MD5 of the decoded audio; all zeros means there is none |
The sample rate, channels, depth and total samples are packed across byte boundaries, 20, 3, 5 and 36 bits, so they take eight bytes between them, starting at byte 10 of the block’s body.
The audio MD5
The checksum is taken over the audio as it decodes: every sample of every channel in turn, channels interleaved, each sample signed and little-endian in the smallest whole number of bytes that holds its bit depth. A decoder can check a whole file against it, and a writer that does not compute one stores all zeros.