FLAC

Over the years, FLAC (Free Lossless Audio Codec) has become one of the most popular open source audio codecs.
It works like Zip; you can compress and decompress the audio without loss.
As FLAC is optimized for audio, the compression is much better than with Zip.
Depending on the music the compression rate will be 30%-50%.

 

FLAC supports linear PCM audio:

FLAC's metadata system supports tags, cover art, seek tables, and cue sheets.
It runs on Windows, OSX and Linux.

 

The integrity of the audio data is insured by storing an MD5 signature of the original uuencoded audio data in the file header, which can be compared against later during decoding or testing.

 

FLAC is very well supported.
The exceptions to this rule is Apple.

Apple don't support FLAC. Hence you can't use it with iTunes.

From Win10 on FLAC is supported by Microsoft.

Compression

You can choose 0 – 8 where 0 is the lowest and 8 the highest compression.
This compression quality is a permanent source of misunderstanding.
A lot of people thing that it works like the bitrates in MP3 so more or less loss.
The compression quality simply tells how many CPU FLAC is allowed to use to find the best possible compression (linear prediction). The more time is allowed the higher the compression.
In practice 5 is often recommended as a nice compromise between coding time and file size.
Going from 5 to 8 in general results in a marginal smaller file.

When Josh Coalson started the development of FLAC this parameter made sense.
With today’s CPU’s you probably won’t notice the difference in time between e.g. 5 and 8.


Regardless of the compression ratio chosen, the result is always lossless.

Bit rate

If you play a 16/44.1 track (CD audio) ripped to WAV you see a bit rate of 1411 Kbit/s.
Play the same track in FLAC format and you will see a lower value, often around 700.
This confuses a lot of people.
If you play MP3 you see a lower bit rate too so people start wondering if FLAC is lossy too.
As FLAC is compressed, the same information is stored using less bits (otherwise you can't get a smaller file….). The bit rate as displayed by your media player is the amount of bits per second read, not the bit rate after expansion to linear PCM.

 

From the FLAC website:
With FLAC you do not specify a bitrate like with some lossy codecs. It's more like specifying a quality with Vorbis or MPC, except with FLAC the quality is always "lossless" and the resulting bitrate is roughly proportional to the amount of information in the original signal. You cannot control the bitrate much and the result can be from around 100% of the input rate (if you are encoding noise), down to almost 0 (encoding silence).

 

Obvious the compression and therefore the bit rate you see varies with the complexity of the signal.
You will see differences between tracks but also within.
In essence it is VBR (Variable Bit Rate) but lossless all of the time.

Uncompressed FLAC

From 14.1 on, dBpoweramp supports uncompressed FLAC

FLAC encoder wording changed, also includes a FLAC Uncompressed encoding option (which stores audio uncompressed, for those who want WAVE PCM but with better ID Tagging).
Source : dBpoweramp

This sounds like we finally have WAV with excellent tagging options.

It is probably not plain PCM as some think.

 

I don't know FLAC algorithms very well, but I think that decoder still needs to convert FLAC bitstream into plain integer values. It requires such operations as byte swap, bit shift, bitwise or, etc. FLAC file cannot store PCM information 'as is'.

Source: https://github.com/xiph/flac/issues/73#event-1667854824

integrity

The integrity of a file can be easily tested by running

FLAC –t FileToTest.FLAC

Flac will exit with an exit code of 1 (and print a message, even in silent mode) if there were any errors during decoding, including when the MD5 checksum does not match the decoded output. Otherwise the exit code will be 0.
http://flac.sourceforge.net/documentation_tools_flac.html

Interface

You don't like typing command lines?

Try this one: FLAC frontend

 

 

References
  1. FLAC – FLAC website
  2. FLAC - Wikipedia
  3. Uncompressed FLAC - J Mac
  4. Ogg Vorbis I format specification - xiph.org
  5. FLAC Frontend - ktficer