
Mp3, differences between CBR and VBR
![]()
Differences in data content between CBR and VBR mp3 files. It can be seen that the bit rate of the VBR encoded mp3 is not necessarily the same due to the difference in data content between frames. Generally, VBR technology will compress and encode in the range of 8~320kbps, so the bit rate of the whole file is higher than that of the whole file. Constant CBR encoding, VBR encoding has a bit rate variable bit rate throughout the file, hence the name VBR (variable bit rate).

In addition to the two encodings CBR and VBR, there is also an ABR (Average Bit Rate, Average Bit Rate) type encoding, which is basically the same as CBR, most audio frames are encoded at the bit rate specified, but they will be The content is encoded with a higher bitrate than specified, but usually this content is short, so there is not much difference in file size compared to CBR, so this type is not common.
Disadvantages of VBR technology compared to CBR technology
Using VBR technology to encode and compress mp3 files can certainly optimize file size, but at the same time, it also brings some new problems in acquiring audio information and monitoring playback progress.
The first is the calculation of the duration of the audio. If it is CBR encoding, since the bitrate is constant, the data size of all audio frames is fixed, so the data size needed to decode for each second of playback is the same, so it is very simple to calculate the audio time length. Just use the following formula:
timelength ( s ) = (total file length (Byte) – total id3 field size (if present)) * 8 / (bitrate (kbps) * 1000 )
In the formula, the id3 field refers to the basic information field that is placed at the beginning or end of the mp3 file, and is generally used to record the audio file name, singer name, and album name. The id3 is divided into two versions, v1 and v2, and only v1 records. The above three types of information, and the size is fixed, are usually placed at the end of the file; v2 is more flexible than v1, the type of the recorded information is not limited to the above three, and the size is not fixed, it is usually placed at the beginning of the file. The id3 field is an optional field, and the mp3 file doesn’t necessarily have it, so to calculate the audio time of the mp3, you must first read it to see if the id3 exists.
For VBR encoded mp3 files, since the bit rate of each frame is not fixed, the data size of each frame is arbitrary. Obviously, the size of the data reproduced per second is different. In this way, the duration of all the audio cannot be calculated with the above formula and other data fields are needed, which is one of the shortcomings of VBR technology: it is relatively difficult and complicated to calculate the duration of the audio.



