How to Check Bitrate of MP3, m4a, & Audio Files from Command Line of Mac OS X
Mac users can quickly get the bitrate of any MP3, m4a, or other audio file from the command line of OS X.
To get started, launch Terminal (from /Applications/Utilities/ or via Spotlight) and then type the following command pointed at a filename to query the bit rate for that audio file:
afinfo filename |grep "bit rate"
The command will report back something like:
bit rate: 320000 bits per second
The bit rate is reported in bits per second but in full notation, so 320000 is the same as 320kbps, 192000 is the same as 192kbps, and so forth.
For example, using this on a file named “thunderstorms.m4a” could look something like the following:
$ afinfo /Users/Paul/Downloads/thunderstorms.m4a | grep "bit rate"
bit rate: 192000 bits per second
In this example, the m4a audio file bitrate is 192kpbs.
The afinfo command is included in Mac OS X and without the attached grep command will report back extended information on audio files as detailed here. It can be a really great utility for many users, particularly audio enthusiasts and audio engineers.
If you don’t like working in the command line, you can also get this information from iTunes by using the built-in Get Info function, which is available in Mac OS X and Windows versions of iTunes, but of course, iTunes is not accessible from the command line in the same manner.