Using ffmpeg to get number of MP3 channels (mono/stereo)

Today we found that we had some MP3s that were only had a single channel (mono). I’ll spare you the details why it matters, but if you want to find the number of channels in an audio file, create the following shell script (assuming you have ffmpeg):

Then you can run:

$ bash my.mp3
my.mp3: Channels: 1
$ find somepath/ -name "*.mp3" -exec bash {} \;