Mp3 format and the differences between VBR and CBR, WHICH IS BETTER?


Free Download Mp4Gain
picture

Mp3 format and the differences between VBR and CBR, WHICH IS BETTER?

CBR & VBR

There is another disadvantage of VBR technology. When playing an audio file, there will inevitably be an operation to jump to the position of the specified time to play (ie, the so-called seek operation).

CBR vs VBR

At this time, it is necessary to convert the time position of the target to the position of the file. Then jump to this file position offset to read and decode. If it is a download and play network playback mode, you must first calculate the position of the file during the search operation. Jump to this position and download a paragraph before continuing to play. . For CBR encoding, the conversion to file position offset is also very simple, using the following formula:

file position (byte) = target time position ( s ) * bit rate (kbps) * 1000/8 + id3v2 field size (if any)
But for VBR encoding, it is obviously impossible to use this formula to convert file position. The reason is also very simple: the bit rate of each frame is not fixed and the length of data per second is not average. Therefore, just like calculating duration, other data fields are needed.

The method to calculate the duration of the audio and implement the seek operation using VBR encoding
To solve the above two problems, VBR encoding adds some data fields. At present, there are mainly two types of VBR encoding technologies, one is the Xing specification proposed by the Xing Company, and the other is the VBRI specification of the Fraunhofer encoder. This article only presents how the Xing specification solves the audio duration computation and the implementation of the seek operation.

The main content of the Xing specification is the Xing header, which means that the first audio frame at the beginning of the VBR-encoded mp3 is not used to store specific audio data, but to store additional audio information. This information is marked with the four characters of “Xing” as the beginning of the field (some files also use the four characters of “Info” as the beginning of the Xing header).

The position of the Xing header in the first audio frame is after the standard 4-byte mp3 audio frame header Between the frame header and the Xing header, there will be a blank part where the data content is all 0. This blank The length of the section is specified. After the decoder parses the frame header of the first audio frame, it skips the blank part of the specified length, and then judges whether the next content is the four characters of ‘Xing’ or ‘Info’ to judge the audio If the VBR encoding.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Author: R. Arias

R. Arias is the author of this article and has extensive experience for more than 30 years as a recording engineer and audio specialist, as well as more than 20 years of experience creating algorithms related to audio and video. Linkedin