FLAC can travel in Ogg instead of its native framing. The first packet holds the STREAMINFO, each later header packet a metadata block, and each audio packet exactly one FLAC frame.
First packet
| Offset | Size | Description |
|---|---|---|
| 0 | 1 | the byte 0x7F |
| 1 | 4 | the ASCII characters FLAC |
| 5 | 1 | major version of the mapping, 1 |
| 6 | 1 | minor version of the mapping, 0 |
| 7 | 2 | the number of header packets after this one, big-endian; 0 means not stated |
| 9 | 4 | the marker fLaC |
| 13 | 4 | the STREAMINFO block’s header (type 0 and length 34) |
| 17 | 34 | the STREAMINFO block |
Header packets
After the first packet, each packet holds one FLAC metadata block with its four-byte
header, such as VORBIS_COMMENT or PICTURE, and the last has the
last-block bit set. When the first packet gives a count of zero, readers go by that
bit.
Audio packets
Each audio packet is one FLAC frame, exactly as in native FLAC. The page’s granule position is the sample number of the end of the last frame finished on it. FLAC in Ogg is unusual: most tools write native FLAC.
Links
- FLAC to Ogg mapping – the mapping’s definition
- FLAC format – metadata blocks and frames in full