xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

question: flac update #688

Closed ghost closed 2 months ago

ghost commented 3 months ago

Hi

I'm a beginner with FLAC. If a FLAC update is released, does this mean also the FLAC file format is changed and it's recommended to re-encode FLAC files encoded with an older version? Or is the FLAC file format never changed itself but only the encoder/decoder is improved?

Thanks!

ktmf01 commented 3 months ago

Hi,

The FLAC format is only changed when absolutely necessary. There have been 4 changes (documented here).

In practice, it means that if you encode 16-bit audio (regular CD-audio for example) with the newest reference FLAC encoder, you can decode it with any FLAC decoder from the last 23 years. For 24-bit audio, there has been an important change in 2007, so if you encode 24-bit audio, those files cannot be played back by the oldest decoders.

Newer FLAC encoders/decoders are often faster or compress better, but remain compatible. It is not recommended to re-encode FLAC files, but it is certainly possible. If you re-encode, files might get a tiny bit smaller (probably less than 0.2%), but if you do, it is a good idea to have a backup copy somewhere. Having a backup is a good idea anyway, even if you do not re-encode.

ghost commented 3 months ago

In practice, it means that if you encode 16-bit audio (regular CD-audio for example) with the newest reference FLAC encoder, you can decode it with any FLAC decoder from the last 23 years.

Is it also true that FLAC files encoded with any older encoder can be decoded by the latest version?

ktmf01 commented 3 months ago

Yes, that is also true, from FLAC version 0.9 onwards, which was released in March 2001.