Explaining Audio File Formats

Computer Science
96 followers
#WAV #MP3 #AAC
Digital audio file formats tutorial, including sample rate, bit depth, codecs, containers, MP3, AAC, WAV, AIFF, BWF, DSD, Monkey’s Audio, WavPack, AC-3, EC-3, AC-4, Ogg Vorbis, Opus and WMA.
Chapters:
00:00 Introduction
00:53 Digital Audio (sample rate & bit depth)
03:16 Codecs & Containers
05:03 Non-compressed audio formats
07:44 Lossless compression formats
10:24 Lossy Compression formats
13:28 Wrap
AI Generated·May contain errors
Video Summary
AI GeneratedThis video provides a comprehensive overview of digital audio formats, explaining the technical parameters that determine sound quality and the differences between various compression methods. It categorizes formats into uncompressed, lossless, and lossy, offering guidance on which to use for production, archiving, or streaming.
Welcome to another video from explainingcomputers.com.
This time we're going to look at audiophile formats.
These can be divided into high quality formats that are not compressed,
high quality formats that use lossless compression,
and lower quality formats that use lossy compression.
In this video we're mainly going to focus on the most popular formats.
But before we turn to any of them,
we need to understand some key digital audio parameters,
as well as the difference between audio codecs and containers.
Digital audiophiles provide an approximation of analog audio waveforms.
And before any compression is applied,
their quality is determined by two parameters
known as the sample rate and the bit depth.
Here the sample rate refers to how many times a second
A common sample rate is 44.1 kHz,
which stores a digital value 44,100 times every second.
44.1 kHz is the sample rate used for audio CDs
and is considered to be high quality as it equates to the capabilities of human hearing.
However, the audio sample rate used in professional video is normally 48 kHz.
And to reduce quality loss during production,
sample rates of 88.1 and 96 kHz are common.
Even 176.4 and 192 kHz are sometimes used,
although these are only necessary when engaging in significant post-production.
Turning to bit depth, most audio formats sample data
using a method called Pulse Code Modulation or PCM,
which allocates a fixed number of bits to represent the height of the audio wave.
So, bit depth refers to the number of bits of data allocated to each sample.
Here, 8-bit audio is low quality as the magnitude of the audio wave
has to be recorded on a scale that offers just 256 digital values.
Stepping up, 16-bit audio provides a value range from 0 to 65535,
which provides much higher quality and is the bit depth used for audio CDs
and many digital audio files.
However, a bit depth of 24 and even 32 is sometimes used for the highest quality.
Here, 24-bit audio allocates 3 bytes to each sample
to provide a sample range of 16,777,216 digital values.
Meanwhile, 32-bit audio uses a floating point numerical representation
that provides an excess of 1038 amplitude levels.
To fully understand digital audio files,
it's important to know the difference between a codec and a container.
Codec stands for Coder-Decoder
and refers to the algorithm used to digitally encode and then decode an audio file.
Meanwhile, a container is a digital box or wrapper
that is used to store encoded audio data and potentially other media information.
Fortunately, many digital audio codecs have their own unique container.
So, for example, MP3 is in effect both a codec and a container.
So, if you have a file with an MP3 extension,
you can be certain that it contains audio encoded with the MP3 codec.
However, this is not the case for all audio formats
where in some cases the file extension indicates the container but not the codec used.
So, to provide another example, the file extension M4A
refers to Apple's MPEG-4 audio container
which may contain audio compressed with the ALAC or the AAC codec.
As this second example indicates,
not all audio file formats can be identified by their file extension
as clearly an M4A file containing ALAC compressed audio
is not in the same format as an M4A file containing AAC compressed audio.
And so, technically, a digital audio format
refers to a combination of an audio codec and a container.
But, in practice, both audio codecs and audio containers
are very widely referred to as formats.
And we just have to live with the ambiguity.
Today, the preferred formats for audio recording and production
are WAV and AIFF, both of which are almost always non-compressed.
However, each format can technically contain compressed data.
WAV, or the Wave Audio File Format,
was created by IBM and Microsoft in 1991
and has a container with the WAV file extension.
In 1997, the European Broadcasting Union
created an extension to WAV called the Broadcast Wave Format or BWF.
However, the audio data is identical
and many BWF files use the WAV file extension rather than BWF.
AIFF, or the Audio Interchange File Format,
was developed by Apple in 1988
and has a container with the AIFF file extension.
And, as you may imagine, it's most popular in the Apple universe.
WAV, BWF and AIFF all support sample rates up to 192 kHz
in up to a 32-bit float bit depth.
However, not all applications and recording devices
can handle the maximum specifications.
For example, whilst the Tascam recorder I'm using right now
can record 192 kHz WAV files, the depth is limited to 24-bit.
A niche non-compressed audio format is Direct Stream Digital, or DSD.
This was released in 1999 by Soli and Philips for their Super Audio CD format.
DSD abandons the pulse code modulation encoding method
described earlier in this video
and, which as we saw, allocates 8, 16, 24 or 32 bits of data to each audio sample.
Rather, in DSD, pulse density modulation is used.
This allocates just one bit per sample
which is used to indicate if the current sample
is higher or lower than the previous one.
DSD has a sample rate of 2.8 MHz for a variant called DSD64
with other variants sampling at 5.6, 11.2 and even 22.4 MHz.
DSD does offer excellent quality audio, but it's difficult to edit.
And, whilst DSD was developed for Super Audio CDs,
these actually store data in a losslessly compressed version of DSD
called Direct Stream Transfer, or DST.
Whilst non-compressed formats provide excellent quality,
this comes at the expense of a large file size.
For example, a 5-minute, 44.1 kHz, 16-bit WAV or AIFF file is 52.9 MB.
Because of this, outside of production,
most audio files are delivered and archived using compressed file formats.
Some of these are lossy, as we'll look at in the next part of the video,
but others are non-lossy and so decrease the file size without reducing sound quality.
The two dominant lossless compression formats are FLAC and ALAC.
Here, FLAC is the Free Lossless Audio Codec
and was released in 2001 by the non-profit Xiphy.org Foundation.
As the name indicates, FLAC is an audio codec,
but it also has a dedicated container with the FLAC file extension.
Released in 2004, ALAC is the Apple Lossless Audio Codec
and often stores its files in an M4A container.
Today, both FLAC and ALAC support a sample rate up to 192 kHz
and a bit depth of up to 32-bit floating point.
File sizes may be up to 70% smaller than WAV or AIFF,
although this does depend on the content,
and here our 5-minute 44.1 kHz 16-bit WAV file
is reduced from 52.9 to 39.6 MB when saved in FLAC format.
Other lossless compression formats are WMA Lossless,
Dolby TrueHD, Monkeys Audio and Wavpack.
The first of these is a lossless version of Microsoft's Windows Media Audio format,
whilst the second is a lossless version of the Dolby Digital family of codecs,
which we'll return to later in the video.
Meanwhile, Monkeys Audio is a free losslessly compressed format
that uses the APE file extension.
Monkeys Audio was released by Matthew Ashland in 2000
and he suggests we can think of it as a beefed up WinZip for your music.
In a similar manner, Wavpack notes
that it acts just like a 7-zip compressor for audio files,
including the preservation of all the headers and metadata
so the restored files are identical to the original.
Wavpack is a free and open format which uses the WV file extension
and was released in 1988 by David Bryant.
Finally, let's turn to lossy compression formats
which sacrifice quality to reduce file size and in turn their bit rate.
Bit rate is a measure of the number of bits transmitted per second
and became an important consideration for digital audio files
when we started streaming music over the internet.
Still, the most common lossy compression format is MP3
which stands for either MPEG-1 Audio Layer 3
or MPEG-2 Audio Layer 3
or even MPEG-2.5 Audio Layer 3 depending on the codec used.
As noted earlier, MP3 has its own unique container with the MP3 file extension.
MP3 was largely developed by the Fraunhofer Society and dates back to 1991.
In its various incarnations, MP3 supports a sampling rate of up to 48 kHz
and a data rate of up to 320 kbps.
And if we save our sample 5 minute 44.1 kHz 16-bit WAV file as an MP3
as we can see it's reduced from 52.9 to 12 MB as a 320 kbps MP3 file.
As an improvement to MP3, Advanced Audio Coding or AAC was released in 1997
and supports a sampling rate up to 96 kHz
and a data rate of up to 384 kbps.
However, these parameters are not supported by all streaming services.
AAC audio may be delivered in many containers
including AAC, M4A, M4B and M4R.
Other formats with lossy compression include those from Dolby Digital
who have developed a codec called the ARC Consistency Algorithm 3 or AC3
as well as an improved version called EC3
which is also known as EAC3, Dolby Digital Plus or DDP.
For good measure we now also have AC4 which has an improved compression efficiency
as well as Dolby TrueHD which as noted earlier has non-lossy rather than lossy compression.
Other lossy compression formats include MQA, Ogg Vorbis, Opus and WLA.
MQA or Master Quality Authenticated is proprietary and high resolution
and has an uncertain future.
In contrast, Ogg Vorbis is an open non-proprietary format that uses the OGG file extension.
Opus is another open format that's great for streaming and uses the OPUS native file extension.
And finally here WMA is Microsoft's Windows Media Audio
which is a less common lossy format than it used to be due to the rise of alternatives.
As we've just seen there are a great many audio file formats.
So which should you choose?
Well to summarize in production WAV and AIFF are the go-to standards
whilst for those seeking perfect delivery quality with a reduced file size
the non-lossy compression formats FLAC and ALAC are ideal.
However for most end-user delivery and particularly streaming
MP3 and AAC provide an acceptable bit rate and file size while still delivering decent quality.
And talking of quality it's worth remembering that most people over 50 cannot hear
for example the difference between a 160 and a 320 kilobits per second compressed file
because beyond the age of 50 most of us lose some of the ability to hear higher frequencies.
But now that's it for another video.
If you've enjoyed what you've seen here please press that like button.
If you haven't subscribed please subscribe and I hope to talk to you again very soon.
