Reference

What is FLAC?

FLAC is a lossless audio codec designed to reduce file size without changing the decoded PCM audio.

FLAC is: a lossless codec and a native FLAC stream/file format. FLAC is not: a fixed bitrate or a guarantee that the original source was high quality.

FLAC technical specifications

PropertyFLAC format limit
Channels1–8
Bits per sample4–32 bits
Maximum sample rate1,048,575 Hz (220 − 1)
CompressionLossless
BitrateNo single fixed range; depends on source PCM, content and compression efficiency

The formal limits are much wider than normal music-library values. Hardware and software support is often narrower than the FLAC bitstream itself.

Common FLAC values

Most music files are 16-bit or 24-bit and use familiar rates such as 44.1, 48, 88.2, 96, 176.4 or 192 kHz. High-end hardware may support 352.8 or 384 kHz FLAC, but that is still only a subset of what the format can represent.

Why FLAC has no fixed bitrate

FLAC stores PCM losslessly, so the encoded bitrate changes with sample rate, bit depth, channel count and how compressible the audio is. Two 24-bit/96 kHz stereo tracks can therefore have different FLAC bitrates while decoding to PCM with the same basic technical resolution.

FLAC codec vs FLAC file

A normal .flac file contains a native FLAC stream plus metadata. FLAC audio can also be carried by other containers, including Ogg, Matroska and MP4 in implementations that support it.

Compression, metadata and verification

FLAC predicts PCM samples from earlier samples and efficiently codes the differences. Unlike a lossy perceptual codec, it must reconstruct the original values exactly. Compression settings change encoding effort and file size, not the decoded audio quality. A file may contain metadata blocks for stream information, seek points, Vorbis comments, pictures and other information. Some applications retain only a subset when converting or rewriting tags.

The Xiph format overview documents the encoder's verification option. For example, flac -V input.wav verifies the encoded output while creating it; flac -t album.flac tests a file. Keep separate hashes and extraction logs for important collections. A valid FLAC checksum proves the data can be decoded as stored, not that the original CD was ripped accurately or that its mastering was good.

Hardware playback limits

A stereo network player, car stereo or television may support only a subset of FLAC rates, bit depths, channels or metadata types. The full format limits should not be used as a device specification. A USB DAC generally receives decoded PCM from an application, not the FLAC file itself. In contrast, a player with a USB storage port may need to parse the FLAC container and decode it internally. Check that the particular input path supports the intended file and layout.

Special CD contents

A bit-perfect stereo FLAC can retain an SQ, QS or Dolby Surround matrix as well as HDCD control codes. It can even preserve DTS-CD sample data, but that data must be recognized and decoded as DTS before reaching speakers. Do not assume a FLAC-capable hardware player supports these secondary decoding stages. A four-channel FLAC is a different case: it carries four discrete PCM channels rather than a stereo matrix that must be expanded.