You can fairly easily just filter the output of a playback program of some sort.
For example, mplayer. If you try the command:
Code:
mplayer filename.mp3 -frames 0 |grep kbit |cut -b 31-35
it should do what you want. Incidentally, it will work for any audio file that mplayer can play, not just mp3.