I. Overview
MP3 files are composed of frames, which are the smallest unit of MP3 files. The full name of MP3 should be mpeg1 layer-3 audio files, and MPEG (Moving Picture Experts Group) should be translated as an expert group of active images in Chinese, especially for activity audio and video compression standards, an MPEG audio file is an audio part of the mpeg1 standard. It is also called an MPEG audio layer. It is divided into three layers based on the compression quality and encoding complexity, namely layer-1, Layer2, layer3, it corresponds to the MP1, MP2, and MP3 audio files respectively, and uses different levels of encoding according to different purposes. The higher the level of MPEG Audio Encoding, the more complicated the encoder and the higher the compression ratio. The compression ratios of MP1 and MP2 are and 6- 8respectively, while the compression ratio of MP3 is as high as-12, that is to say, music with a one-minute CD sound quality requires 10 MB of storage space without compression, and only about 1 MB after being compressed by MP3. However, MP3 uses lossy compression for audio signals. To reduce sound distortion, MP3 adopts "sensory encoding technology", that is, Spectrum Analysis of audio files is performed before encoding, then filter out the noise level, and then sort the remaining bits in a quantitative manner to form an MP3 file with a relatively high compression ratio, in addition, the compressed file can achieve sound effect close to the original audio source during playback.
Ii. Entire MP3 file structure
MP3 and WAV Files are different. MP3 files do not have file headers. MP3 files consist of frames. Each frame includes the frame header and frame data ), MP3 files are divided into three parts: tag_v2 (ID3v2), frame, tag_v1 (id3v1). It is worth mentioning that tag_v2 (ID3v2) and tag_v1 (id3v1) are also frames, it can be called a tag frame, and the frame part can be called a data frame. In an MP3 file, there are not necessarily tag frames, but data frames.
1. ID3v2
Contains the author, composing, album, and other information. The length is not fixed, and the information of id3v1 is extended.
2. Frame
The number of frames in a series is determined by the file size and frame length. The length of each frame may be unequal or equal, determined by bitrate; each frame is divided into two parts: the frame header and the data entity. The frame header records information such as the bit rate, sampling rate, and version of MP3. Each frame is independent of each other.
3. id3v1
Contains the author, composing, and album information. The length is 128 bytes.
Iii. Types of MP3 files
Based on whether the bitsrate of frame (data frame) in MP3 is the same, it can be divided into two categories of MP3 files: the bit rate of frames is equal, called CBR (constant bitrate ); the bitrate of frames is not equal, which is called VBR (variable bitrate). The MP3 file of VBR defines two specifications: Xing and vbri files. See the following table:
Equal bit rate (constant bitrate) |
CBR MP3 file |
Bit Rate (variable bitrate) |
Xing MP3 files |
Vbri MP3 files |
I. MP3 file Overview