FLAC - Free Lossless Audio Codec - seems to be all the rage these days on that internet. Everyone’s all into it because it’s lossless, whereas Mp3’s are lossy and use compression.
But wait a second - FLAC files are HUGE, about the same size as the standard wav or aiff files that are burned to CD’s in the first place.
Why aren’t people just trading full wav’s? Why the desire for some sort of weird, proprietary new codec?
No. FLAC has been heavily optimized for audio data in order to wring every last bit of compression possible out of its algorithms. ZIP or RAR just can’t compete. I believe that Monkey’s Audio (APE) can get slightly better compression ratios but, unlike FLAC, that format is proprietary.
As others have said, FLAC is free, open-source, shrinks WAV files to about half-size and is under constant development (unlike other seemingly abandoned alternative formats like OGG). Another major advantage over WAV is that FLAC files can be tagged with meta-data, which isn’t possible with raw WAV files.
Personally, I rip every CD I purchase directly to my hard-drive in FLAC format and then file the disc away. I do this, not because I can hear the difference between lossless files and 192 kbit MP3s (I can’t), but because I can then transcode to a variety of different formats for car, MP3 player or stereo use without having to touch the original CD again.
On a slightly related note, can anyone explain how FLAC achieves lossless compression? I understand (at a very basic level) how traditional compression strategies work, as well as mp3 compression. Wikipedia says this:
which doesn’t really help me. Anyone want to try to explain the basic ideas behind this, in simpler terms?
Take this with a grain of salt, as I don’t really know what I’m talking about, BUT…
I think what it’s saying is that an audio file is basically a curve. You know, that wavy line that you see in various visual depictions of what comes into a microphone. So, when you’re plotting a curve, you can usually guess pretty closely where the next point is going to be. So if it’s 16 bit audio, you have a value between -32768 and +32767, and based on the 5 previous points on the curve, your simple predictor predicts that it will be +2115. In fact, it happens to be +2113. So you take the difference (how far off you were), which is +2. So you do that for your whole file, and get a whole bunch of very small numbers (+1, +2, -3, 0, +5, -2) etc. Then you run THAT through a “normal” compression scheme to store it as efficiently as possible.
Basically, it’s super simple once you have your general algorithm for predicting what the next point in the curve will be. And the better that algorithm is, the smaller your “error” numbers will be and the better your compression will be.