WinMP3Packer Beta released
Reply #61 –
or perhaps using mp3packer.exe itself to read file information, but I think that could be a little bit slower.
It probably would be, since mp3packer reads every single frame. That is the only way to make 100% sure if a file is VBR, but it is also the slowest way.
The best way I've seen to handle VBR files (if the VBR header isn't there) is to seek to some number of random places in the file. At each position sync to the next frame and read its bitrate, then average out all the bitrates. This would be very fast (depending on the number of sample points) and should be able to tell if the file is VBR with only a few samples.
Actually, since you don't need to know the exact bitrate, you can probably do an adaptive approach: get one sample. Then, keep getting another sample until you find one that doesn't match the first sample's bitrate. In this case, it's VBR. After a set number of samples (say, 10) at the same bitrate you can assume it's CBR.