Tuesday, 7 May 2019

linux - How to know whether a audio file is CBR or VBR?


File size of an CBR(Constant bitrate) audio recording can be calculated using a formula:


File Size (Bytes) = (sampling rate) × (bit depth) × (number of channels) × (seconds) / 8

E.g., a 70 minutes long CD quality recording will take up 740880000 Bytes, or 740MB:


44100 × 16 × 2 × 4200 / 8 = 740880000 Bytes 

But it doesn't work if the audio is VBR(Variable bitrate). How to know whether a audio file is CBR or VBR?



Answer



Install Checkmate first (the .deb file) by double clicking it and selecting Install in Ubuntu Software Center.


Then, open up a terminal with CtrlAltT and call:


mpck input.mp3 | grep "bitrate"

This will tell you precisely whether a file is CBR or VBR. If it's CBR, you'll just see the bitrate, and if it's VBR, after the average bitrate label you'll see (VBR).



I tested this on Ubuntu 12.04, but packages for Checkmate are available for Windows as well.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...