Wade's Site

Audio Basics 101: Issue One

Published on

This is my new series, where I explain audio technicalities in simple terms. Only facts, no snake oil.

In this first issue, I'll break down codecs, uncompressed lossless, and compressed lossless.

Let's start with codecs. What are they?

A codec is a way to digitally store audio (and video, but this is Audio Basics 101). Different codecs store audio in different ways. Some are better or more efficient than others.

A format is a container that stores these codecs. Think of codecs as your lunch and the format as your lunch box. You've seen my uploads have a .m4a file extension, but they're AAC files. M4A (audio-only MPEG-4) is the format (lunch box), AAC is the codec (lunch). The terms are often interchanged. Clear?

Before we dive in, two more terms: encode and decode. Encoding is packing, and decoding is unpacking. Different codecs come with different encoders and decoders.

Audio codecs can be classified into two categories: lossless codecs and lossy codecs.

This time, we'll cover only lossless codecs. As the name suggests, these codecs store every bit of information as it is. Nothing is thrown out. Within lossless codecs, there are two sub-categories: uncompressed lossless and compressed lossless.

You all know ZIP files, right? You take a huge file, and you compress it to save space. No data is lost, it's just repacked with more efficiency. When you decompress it, you get exactly what went in. No data loss. Game repacks are an excellent example.

Compressed lossless codecs are like ZIP files. They store every bit of information, but they store it in an efficiently compressed manner. In uncompressed lossless codecs, even silence takes up the same space (or bits) as sound.

WAV, AIFF, etc., are uncompressed lossless codecs (if you want to go down a rabbit hole, look up linear pulse-code modulation). FLAC, ALAC, APE, etc., are compressed lossless codecs.

Yes, this means WAV and FLAC have the exact same information, bit for bit. FLAC just stores it efficiently. If you're storing your music in WAV, convert them to FLAC. You're just wasting storage space with WAV.

Since lossless codecs store every bit of information, you can convert from one lossless codec to another with zero data loss. WAV to FLAC to AIFF to ALAC to APE back to WAV. It's still the exact same information. Nothing is lost.

If they're the same thing, then why do uncompressed lossless codecs even exist? Why aren't they all FLAC?

Remember the game repack example? Ever tried to install one? It takes a long time. Compression comes at the cost of speed. For listening, this doesn't matter. FLACs are decompressed fast enough that you don't notice a thing. But when working with audio, like producing or editing, it's not fast enough. Even milliseconds matter. Uncompressed lossless will be processed in real-time with zero delays.

Compressed lossless is better for storage as it takes up less space. Uncompressed lossless is better when you're working with the audio, as there's no processing delay for unpacking it. It's already unpacked. Remember, both have the exact same audio data in them, nothing is lost. You can still use compressed for editing and uncompressed for storage, it's just not ideal.

Any time you're working with audio (producing/mixing/mastering/editing/whatever), you must always use lossless formats. Imagine you have a photo. Your friend is good at editing photos. You send it to him over WhatsApp (not as a document), he edits it, and sends it back to you (also not as a document). Each time the photo goes back and forth, it gets worse. If you both had sent it as documents, the photo would remain crisp no matter how many times you sent it back and forth. Makes sense, right? The idea is the same with lossless audio.

Your music collection must also be gathered and stored (but not necessarily listened to) in lossless formats. Why? Preservation. Preserve every bit of data there is.

Quick recap. Codecs are ways to digitally store audio. Formats are containers for codecs. The terms are sometimes interchanged. Encoding is packing, decoding is unpacking. Lossless codecs store all audio data as-is. Compressed lossless is efficiently packed lossless.

I hope this was clear. In the next issue of Audio Basics 101, I'll explain lossy audio codecs in detail. If you have any questions from the above, please reply, and I'll explain.

See you in the next one!