Audio Codec

Pranit Patil
7 min readJun 13, 2022

Introduction:

Every time we open any audio record, we see it as prolonged with extension as MP3, WAV and so on. These extensions are referred as audio codec. Firstly, we should know what codec is? A Codec is a phrase made via way of means of blending the phrases coder/decoder. It is a tool or pc application or a set of rules which encodes or decodes a statistics circulation or sign. It compresses the record for transmission and decompresses the obtained documents upon playback. Codec plays very important role in audio playing. The objective of the algorithm is to represent the high-fidelity audio signal with minimum number of bits while retaining quality. This can effectively reduce the storage space and the bandwidth required for transmission of the stored audio file. Though you are making the use of a completely excessive-give up tool for streaming tune, however in the long run, your first-rate of audio will rely upon the codec that has been selected to method the audio record you’re listening to. The audio first-rate of any audio depends in the main on 3 variables:

1) Sampling Rate / Sampling Frequency

The first term we often hear about is the sampling rate or sampling frequency, which both refer to the same thing. Some of the values you might have come across are 8kHz, 44.1kHz, and 48kHz. The sampling rate refers to the number of samples of audio recorded every second. It is measured in samples per second or Hertz (abbreviated as Hz or kHz, with one kHz being 1000 Hz). What exactly is the sampling rate of an audio file? The sampling rate is analogous to the frame rate or FPS (frames per second) measurement for videos. A video is simply a series of pictures, usually called in this context “frames”, displayed back to back very quickly to give the illusion (at least to us humans) of continuous non-interrupted motion or movement.

2) Sample Depth / Sample Precision / Sample Size

In addition to the sampling rate, which is how many data points of audio we have, there is also the sample depth. Measured in bits per sample, the sample depth, (also known as the sample precision or sample size), is the second important property of an audio file or stream, and it represents the level of detail, or “quality” each sample has. As we mentioned above, each audio sample is just a number, and while having a lot of numbers is helpful to represent audio, you also need the range or “quality” of every individual number to be large enough to represent each sample or data point accurately.

3) Bit Rate:

Tying the sampling rate and the sample depth together is the bit rate, which is simply the product of both. Since the sampling rate is measured in samples per second and the sample depth is measured in bits per sample, it is therefore measured in (samples per second) x (bits per sample) = bits per second, abbreviated as bps or kbps. It’s worth noting that because the sample depth and the bit rate are related, they frequently, yet erroneously, get used interchangeably.

The bit rate in audio varies according to application. Applications that require high audio quality, like music, usually have a higher bit rate yielding higher quality, or “crisper” audio. Telephony audio, including that of call centres, doesn’t need a high bit rate, and so the bit rate for an ordinary phone call is usually much lower than that of a music CD. For either the sampling rate or the bit rate, lower values might (literally) sound worse, but again, depending on the application, lower values save storage space and/or processing power.

Now let’s discuss about these types of codecs in detail one by one.

Lossy audio:

Lossy audio compression is used to compress larger files into smaller files. In this compression technique, some specific amount of data and quality are removed (loss) from the original file. It takes less memory than the original file due to the loss of audio data and quality. This technique is generally useful for us when the quality of audio is not our first priority. There are different levels of lossiness. For example, 128kbps file takes up very little space, but will also be lower quality than a larger 320kbps file. 320 kbps is lower quality than an even larger 1,411 kbps file (which is considered lossless). When it comes to compatibility, lossily compressed files are an advantage. While some devices and software programs support a wide variety of audio formats, lossy formatted files like MP3s will work on any device. Examples of lossy audio files are AA3, AAC, MP3, OGG, MPC, WMA.

Lossless audio:

Lossless data compression is used to compress the files without losing an original file’s quality and data. The main advantage of lossless data compression is that we can restore the original data in its original form after the decompression. When music is in a lossless format, one can convert it to any format and achieve the highest quality that format can support. Lossless compression can reduce file sizes by up to 50% without losing quality. FLAC and ALAC are open source lossless compression formats

Differences:

Uncompressed audio:

Uncompressed audio consists of real sound waves that have been captured and converted to digital format without any further processing. Uncompressed audio has no compression implemented in it at all. A minute of such an audio can take round 10MB of your garage drive.

MP3:

Moving Picture Experts Group Layer-three Audio or MP3 for short, is the most common lossy format. So much so that it’s become synonymous with downloaded music. MP3 isn’t the most efficient format of them all, but its definitely the most well-supported.

AAC:

Advanced Audio Coding, also known as AAC, is similar to MP3, although it’s a bit more efficient. That means that you can have files that take up less space, but with the same sound quality as MP3. And, with Apple’s iTunes making AAC so popular, it’s almost as widely compatible with MP3.

FLAC:

The Free Lossless Audio Codec (FLAC) is the most popular lossless format, making it a good choice if you want to store your music in lossless. Unlike WAV and AIFF, it’s been compressed, so it takes up a lot less space. However, it’s still a lossless format, which means the audio quality is still the same as the original source, so it’s much better for listening than WAV and AIFF. It’s also free and open source, which is handy if you’re into that sort of thing.

ALAC:

Apple Lossless: Also known as ALAC, Apple Lossless is similar to FLAC. It’s a compressed lossless file, although it’s made by Apple. Its compression isn’t quite as efficient as FLAC, so your files may be a bit bigger, but it’s fully supported by iTunes and iOS (while FLAC is not). Thus, you’d want to use this if you use iTunes and iOS as your primary music listening software.

WAV:

Waveform Audio File Format (WAVE, or WAV due to its filename extension pronounced “wave”) is an audio file format standard, developed by IBM and Microsoft, for storing an audio bitstream on PCs. It is the main format used on Microsoft Windows systems for uncompressed audio. The usual bitstream encoding is the linear pulse-code modulation (LPCM) format. WAV is a superior choice when you require extraordinary sound. It is an uncompressed audio layout, so the documents have a tendency to have quite large size. Hence, they’re perfect for shorter sound bites. Since their length is large, they also can be hard to circulation at instances, mainly when you have constrained bandwidth.

AIFF:

AIFF, or Audio Interchange File Format, is an audio layout is developed by Apple. It is uncompressed, which makes the file size larger. Hence, its downside is that it is lengthy and absorbs a large amount of memory. Therefore, it is not suitable for portable devices. AIFF is equal to CD-first-rate audio, and may be performed on each Macs and PCs. It is feasible to circulate in AIFF format. However, it is now no longer considered by people. AIFF originated as a replacement for WAV, and while it is no longer as well-known, it offers better metadata support. This method allows you to include album artwork, song titles, and more.

MQA:

MQA, or Master Quality Authenticated, is a lossy audio codec. MQA aims to “fundamentally change the way we all enjoy music”. It’s a method of digitally capturing and storing original master recordings as files that are small and convenient enough to download or stream, without compressing the files. MQA claims its tracks use a similar bandwidth to that required for CD-quality streams.

Which CODEC Is suitable for us?

There is no proper answer for this question. It always depends on what are the requirements and priorities. The first-rate layout for sound is a lossless or uncompressed audio record layout. FLAC, WAV, and AIFF are examples of these formats. The downside is that these files may be quite huge. MP3 is the best audio recording format for the internet. This layout is supported by all current browsers. AAC and WAV are two other codecs that are supported by most browsers. At the end of the day, it’s going to be a trade-off you’ll have to make. You should figure out what you’ll charge extra for and in what order:

1) Sound quality

2) Storage space

3)Download time

Thank You!

Regards…

Amitesh Patil

Kshitij Patil

Pranit Patil

Vivek Pundkar

--

--