I'm trying to write a bash command to display my music library sorted by bitrate. The command has to be recursive, as I have files organized like: music/artist/album/song.mp3
This displays all mp3s with bitrate information, but without sorting:
find . -type f -name '*.mp3' -exec file {} \;
If you use the commas in the output of the file command as delimiters, the bitrate is between the fifth and sixth commas, so I tried to sort the command like this:
find . -type f -name '*.mp3' -exec file {} \; | sort -n -t, +5 -6
but it doesn't work. Tips?
EDIT:
The output of that find command is something akin to:
./Stemage/Metroid Metal (Original)/supermetroid_brinstar.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo
./Stemage/Metroid Metal (Original)/metroid_kraid.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo
./Stemage/Metroid Metal (Original)/metroid_itemcollect.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo
./Stemage/Metroid Metal (Original)/metroid_tourianbrain.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo
./Stemage/Metroid Metal (Original)/metroid_ending.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo
./Stemage/Metroid Metal (Original)/metroid_metaltheme.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo