
Understand audio codecs

A codec, or, in other words, an encoder, is a software or hardware tool for encoding and decoding information (in our case, audio information) according to a certain algorithm. There are a large number of codecs on the market, but we will consider only a few of them, the most popular and in demand.

AOoding, or compression, can be of two types: lossy and lossless. For each type of encoding, there are different types of audio codecs. How is lossless coding different from lossy coding?
When information is encoded without loss, data compression does not lead to loss of information, and thus the decoded audio file is absolutely identical to the original. By coding in this way, the reduction in the initial volume of information reaches 20-50%. Increasingly, this method is used not only by audiomaniacs, but also by ordinary users. As disk space increases and the price of drives decreases, more and more users are choosing to store audio data encoded in this way. Today, there are quite a few algorithms that allow you to do this, but the most popular are those implemented in the FLAC, Monkey’s Audio, WavPack, and TTA codecs.
Lossy data compression is used to obtain the smallest file size. With this encoding, there is no longer a complete match between the original and its converted copy, and there is no way to recover lost information. To achieve the minimum file size, various encoding algorithms are used, from mathematical compression algorithms, in which the quality of the track is not affected, to the so-called psychoacoustic model, which involves removing the “unnecessary” sounds from the original. and reduce the frequency range. Due to the peculiarities of the perception of sound by the human ear, “unnecessary” sounds can conventionally be called those parts of the audio track, the removal of which will not be very noticeable. The very process of eliminating “unnecessary” sounds is called quantization.
There are many lossy compression methods, the most famous of which are MPEG-1 Layer 3, MPEG-2/4 AAC, Ogg Vorbis, Windows Media Audio, MusePack, etc.
Lossless compression
FLAC
One of the most popular formats for lossless audio compression is the FLAC codec. The main advantages of this audio codec are its constant updating and, of course, cross-platform: FLAC compiles on many platforms: Unixes (Linux, BSD, Solaris, OS X), Windows, BeOS and OS / 2. This comprehensive support of the operating system facilitates the widespread use of this audio encoder.
Another advantage of the FLAC audio codec is the presence (in addition to the basic encoder and decoder in the form of libraries that are included in the installation kit) a graphical shell that simplifies the encoding process, as well as external modules (plugins) for different players (including Winamp of different versions, Foobar2000, etc. etc.). The kit also includes a command-line utility for compressing and decompressing files and a utility for editing file metadata.
An interesting distinctive feature of FLAC is that it allows you to make an archival copy of an audio CD, burned to a. In the future, such a copy can easily be written to the disc in case the original disc is lost or damaged. FLAC uses eight compression rates. As with any encoder, the encoding rate and the size of the resulting file depend on the compression rate. ID3v1 and ID3v2 tags can be added to the FLAC stream. This data is not related to the format, but the decoder can pass it.
Monkey Audio
Perhaps the most popular lossless compression codec today is Monkey’s Audio. This is mainly due to the fact that this codec is free and the high-quality compression of the audio stream it provides. The only factor limiting its scope is the lack of cross-platform support: Monkey’s audio codec is present only on the Windows platform. However, support for this format is implemented in various players and, for example, a plug-in for the Winamp player comes with Monkey’s Audio. Additionally, DirectShow filters can be installed for other compatible players. Playback plugin supports all common functions and ID3 tags.
Monkey’s audio codec will certainly be appreciated by those who need the highest sound quality. The codec provides a compression of approximately 40-50%. When encoding data, several different compression rates are available, from a parameter that provides faster encoding to a parameter that performs better compression at the expense of more processor time.



