Expand description
FLAC.
The first handler in Phase 2’s fourth group (ADR-0037), and the format that makes the group look easier than it is: a four-byte magic, a list of typed metadata blocks, then audio frames to the end of the file. The identifying material is all in the block list — a Vorbis comment naming the artist, the ripping software and the machine that ripped it; cover art that is an ordinary image with its own Exif inside it; a cuesheet carrying the catalogue number of the disc it came from.
§Block surgery, never re-encoding
Blocks are dropped whole and everything else is copied through as raw bytes, so a clean file comes back byte-identical — the property GIF and JPEG XL have and TIFF and HEIF cannot (ADR-0033, ADR-0034). Nothing here decodes audio. Removing a block moves no offset: a seek point’s offset is measured “from the first byte of the first frame header” (RFC 9639 §8.5), not from the start of the file, so the seek table stays valid however much metadata goes. That one sentence of the spec is why this tranche is cheap and MP4 is not (ADR-0037).
The only field rewritten anywhere is the last-metadata-block flag in a block header, which says whether another block follows (§8.1) and therefore has to move when the block after it goes.
§Padding is kept at its length and zeroed, rather than dropped
§8.2 says a padding block is n zero bits. Real encoders leave several kilobytes of it so a later tagger can write in place, and real taggers leave whatever they were holding in it. So the bytes are replaced with the zeros the spec calls for and the block keeps its size: a compliant file is unchanged, a file hiding data in its padding is scrubbed and told about, and the room a tagger needs is still there.
§Tags glued to the ends, which are not FLAC at all
Taggers write an ID3v2 tag in front of the stream marker and an ID3v1, APE or Lyrics3 tag past
the last frame. Neither is FLAC — §8 has no room for either — and a decoder skips them, so they
survive every block this handler cleans. They were refused outright until the MP3 tranche put a
reader in the tree; now they are peeled by [super::tags] and the FLAC in between is walked
(ADR-0040 lifts ADR-0038 decision 7).
§What is kept, and the one thing that is kept and declared
STREAMINFO is mandatory and first (§8.2), and its last sixteen bytes are an MD5 of the
unencoded audio. That is a fingerprint, and it is left alone: it is computed from the samples
the file still carries, so anyone holding the file can recompute it and removing it hides
nothing from them. It is declared in the report rather than passed over in silence, because
it does link this file to any other copy of the same recording.
Structs§
- Flac
Handler - Removal of metadata from FLAC audio.