Audio formats

Almost all audio files contain both the audio and the tags.
Tags are small pieces of information like album title, track number, track title, artist, cover art, etc. Most of the time the tags are in the header.
Tags makes the file self-documenting.
If you move an audio file to e.g. a portable, the media player reads the tags and displays them in the interface.

More about tagging.

Types

Audio files come in three flavors.

Lossless and uncompressed

Well-known examples are WAV (Waveform audio format, developed by Microsoft and IBM) and AIFF (Audio Interchange File Format, a format developed by Apple Computer in 1988).
Most of the time they contain audio in uncompressed PCM (Pulse Code Modulation) format.
If you rip a CD straight to WAV, you rip 16 bit/44.1 kHz PCM Red book audio format to 16 bit/44.1 kHz PCM in WAV format, this is as close as you can get to the original source.

 

Pro:
No loss of quality
If you have your audio in a lossless format you can convert to any other lossless format without generation loss.

 

Cons:
Uses a lot of disk space.
In case of Redbook audio: bits * sample rate * channels = 16 * 41000 * 2=1411200 Bits/sec ≈ 172 Kb per second.


Today a 1 Tb HD sells at € 50,-
You can store approximately 1600 CD’s on it.

 

Tagging WAV is a problem. Due to a lack of standardization portability of the tags is poor.
Best practice is probably to act as if tags in WAV are not supported at all.

Lossless compression

The data is compressed without any loss of information. This is similar to how WinZip works, except you get a better compression because the software is designed specifically for audio. Examples are: FLAC  (Free lossless Audio Codec), Monkey's Audio (APE), WavPack (WV), Tom's lossless Audio Kompressor (TAK), Apple Lossless (ALAC) and Windows Media Audio Lossless (WMAL).

Over the years FLAC has gained momentum.
It is probably the most popular non-proprietary format in this category.

 

Pro:

Cons:

the flac commandline decoder has a test function, it will attempt to decode the audio and tell you if it has any errors or doesn't match the checksum.
foobar also can test, see the context menu 'verify integrity'

Source: Hydrogenaudio

Lossy compression

MPEG-1 Audio Layer 3, more commonly referred to as MP3, is a popular digital audio encoding, lossy compression format, an algorithm designed to greatly reduce the amount of data required to represent audio.

It was invented by a team of European engineers of Philips, CCETT (Centre commun d'études de télévision et télécommunications), IRT and Fraunhofer Society, who worked in the framework of the EUREKA 147 DAB digital radio research program, and it became an ISO/IEC standard in 1991.

 

Several bit rates are specified in the MPEG-1 Layer 3 standard: 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256 and 320 Kbit/s, and the available sampling frequencies are 32, 44.1 and 48 kHz.

Higher rates then 320 don't make sense; the file size will equal those of lossless compression.

 

Pro:

Cons:

Question: from what I read it seems FLAC is better than mp3. Can I change all my itune mp3's to FLAC?
Answer: technically this is possible but it won’t help you. What is lost in the lossy compression to mp3 is lost forever.

WAV versus FLAC

One of the many endless  debates is WAV versus FLAC.
There are claims that WAV sounds better.
Of course there are also claims that there is no audible difference at all.

In general the differences are explained as that the decompression of FLAC requires more CPU power and this will affect sound quality negative.
Effectively this means that the system has a sound card whose quality fluctuates with system load. Reason why some conclude that this is not a matter of a difference between WAV and FLAC but a badly designed system.

More...

 

An argument in favor of  WAV is the cost of storage. Why bother, why running even a hypothetical risk as storage is very cheap today?

The advantage of FLAC is its support of tagging. As mentioned above, tagging WAV is a problem.

One thing is obvious, if you rip to FLAC, you have a collection in a lossless format and each file is self documenting (the tags).
You will appreciate this the moment you use another player.
Another advantage is that FLAC has a checksum which will detect data corruption.

 

the flac commandline decoder has a test function, it will attempt to decode the audio and tell you if it has any errors or doesn't match the checksum.
foobar also can test, see the context menu 'verify integrity'

Source: Hydrogenaudio

 

My advice is an obvious one:
Rip a couple of tracks to WAV and to FLAC
Do a listening test
Best practice is of course to do so unsighted. Don't let your expectation bias fooling you.

Ripping

When you rip your CDs, you have to choose a file format.
The decreasing price of a hard disk lowers the need for a compact format.
Why temper with sound quality if € 50,- buys you a 1 Tb hard disk.
Maybe today you don't hear the difference between a high bit rate MP3 and a lossless format.
Maybe tomorrow you buy that revealing piece of high end equipment.
Rip to a lossless format.


Best is choosing a lossless format with good support of tagging.

The format itself is not really crucial.
There are plenty of good converters like dbPoweramp enabling you to convert to any other format if needed.
Observe, lossless=lossless, sound quality won’t degrade when converting to another lossless format. It remain the same bits stored in a different format.

Lossless allows you to convert your music to any format you need without suffering generation loss.

Transcoding

You choose a lossless format but your MP3 player accepts MP3 files only.

To maintain two libraries, one in FLAC and an identical one in MP3 is a horrible job.

The answer is transcoding. A lot of players support conversion to another format on the fly.

How low can you go?

If you have the same audiophile neurosis as I have, the idea only that there is some information removed (that’s what MP3 does in a very clever way) spoils your listening pleasure.
All of a sudden you see on Amazon the track you wanted to have for years.

Wow! Eureka!

Oh no, it is only available in MP3. Shit!!!!

 

Amazon MP3s are made with LAME at 256 kbps.
Lots of people can't hear the difference between the original CD and a 192 kbps MP3.
So don't worry, get it and enjoy. MP3 is not that bad.

High resolution

Recordings are often made with a greater bit depth (24) and a higher sample rate.

One of the benefits of computer based audio is that you are not in need of recordings down sampled to CD format.
You can play the original recording at its original bit depth and sample rate (if your sound card allows for it).

Audio with a bit depth of 24 and a sampling rate > 44.1 kHz is called high resolution audio.

 

Question: I have a macbook pro, I have downloaded MAX, and I have a 24/96 recorded Chesky cd. I am having problems importing this cd into itunes at 24/96.

Answer: a (Redbook audio) CD contains 16/44.1 regardless of the resolution used in the recording.

How to test

If you want to hear the differences between file formats and especially between lossless and lossy you must use music putting the compression to test.

Small settings are recommended, there isn't much to mask in it. (No, a recording of John Cage's 2"33 is not a good example).

Harpsichord is often mentioned, it generates a lot of high pitch harmonics.

Likewise cymbals.

Instruments requiring high rise times (percussion).

Solo Harpsichord (not just the SQAM thing) is hard.

Hammered Dulcimer (the Cooder thing) is ((*&* hard.

Suzanne Vega is hard.

Percussion music (the Asian variety) is sometimes hard.

Low-pitched, open-vocal tract spoken voice can be hard. (German Male speech from SQAM)

"Glockenspiel and Drums" is pretty brutal (but made deliberately)

Broadband classical generally isn't. But that's only "generally".

Woodinville

SQAM=Sound Quality Assessment Material

The EBU (European Broadcasting Union) SQAM can be found here.

How to set up the listening conditions can be found here.

Some 'killer' samples can be found here.

The Pre-echo Machine, ABXing Kraftwerk's The Man Machine at 320kbps CBR Mp3
References

Perceptual Coding - J. D. Johnston.