MP3 has become so intertwined with daily life that it is hard and unbelievable to imagine that there was once a time when MP3 did not exist. It can be boldly said that with the emergence of MP3, a new culture also came into being. Before the advent of MP3, to listen to music, you either had to use cassette players or compact discs. The data related to a piece of music was so voluminous that a CD could only hold 15 standard music tracks, and cassette tapes were only capable of storing 90 minutes of sound. In such a situation, the Walkman player was considered a completely luxurious and unnecessary device, and most people used radios or home players to listen to music.
In 1982, the MP3 format was introduced under the management of Professor Musmann and a group of researchers from the Moving Picture Experts Group institute, with the support of AT&T and Thomson companies, and finally, the transformation happened. The introduction of this format by itself was a major revolution in the world of music; because the MP3 compression algorithm causes a significant reduction in audio data.

How does MP3 work?
In fact, MP3 is a format for compressing audio data that is based on human physiology. MP3 is built on the following principles:
- First rule: Eliminate any sound that the human ear cannot hear.
- Second rule: If a loud sound is played simultaneously with a soft sound, eliminate the soft sound because it won’t be heard anyway.
- Third rule: Some sounds are well perceptible to the human ear. Cover these sounds with low encoding.
As evident from the rules above, the MP3 format is a Lossy compression format; meaning that part of the original data is permanently lost. But don’t worry. The part that is removed may not be audible to the human ear at all, and the part that remains is essentially the main component that forms the sound.
With this compression method, a 32 megabyte music file will be converted to a 3 megabyte file; meaning almost 10 times smaller, and this means storing ten times more on existing storage spaces! In addition, reducing the size of audio files also helps in transferring them quickly, and this very thing led to the emergence of online music streaming sites; sites that, before this format, were not technically feasible.
Given the investment by commercial companies such as AT&T in the MP3 format, it is obvious that this format is not free and open, and users need to obtain a license to create a file in this format. This is why Linux, as an open-source and free operating system, does not add this format to its operating system by default. However, there are many alternative formats, and the most famous open-source alternative codec to MP3 is the Vorbis codec, which is completely free for public use.
What information does MP3 contain?

As you can see in the image above, every MP3 file can contain supplementary information about the stored music; information such as the artist’s name, album image, music genre, and so on.
Of course, depending on the MP3 file version, these data have limitations, and in the latest ID3 version, it is possible for all data to exist together in one file. These data give playback devices the ability to provide comprehensive music information to the user and even help the device adjust the output filter depending on the type of music.
Alongside all this information, the audio data is also present, which must be decoded from its encrypted state to be heard.
Storage of audio data in MP3 file

In the MP3 structure, to further reduce the size and optimize the compression algorithm, an audio file is broken into various parts based on the nature of the sound and its physics, and each part is called a Frame. Each frame has a header that specifies in what format and at what bitrate this part of the file should be played back. This capability helps files to be stored more optimally. Suppose a audio file contains low frequencies in the first 10 seconds and higher frequencies 5 seconds later; if this capability does not exist, we would have to store the entire file with a high bitrate, and this would cause the file size to be much larger than the case where the first 10 seconds with low frequency are stored with a low bitrate and the next 5 seconds with a high bitrate. For the correct playback of an MP3 file, it is necessary to play each frame individually according to its specifications and with the appropriate bitrate.

