Find MP3 files with specific sample/frequency rate

426 Views Asked by At

I have a media server with a few thousand MP3 files. There is a music folder, and then sub folders generally of artist > album. So the MP3's themselves are not all in one folder.

I am having an issue with SHOUTcast where it won't play MP3's with a sample/frequency rate of 48khz.

So I need to find all MP3 files that are of that sample/frequency rate so I can convert them down to 44khz.

Any suggestions about how to find those types of files among the thousands?

I can access these files from a Linux Mint machine (where they reside), as well as Windows 7, 8, and 10 machines on the network.

Windows Explorer offers bitrate, but not sample/frequency rate, as a detail column. Plus I'd have to go into each subfolder.

So I am thinking some kind of searching/filtering application that looks in the main music folder and goes down into subfolders - any ideas or suggestions are much appreciated.

1

There are 1 best solutions below

0
On

You can use standard "file" Linux utility combined with the power of "find". Something like this:

find -type f -iname "*.mp3" -exec sh -c 'file {} | grep "44.1 kHz" > /dev/null && echo {}' \;

(replace "44.1 kHz" with 48 or whatever samplerate you are looking for) It:

  • finds all *.mp3 files in the current directory
  • runs "file" on them
  • if there is a 44.1 samplerate it is being grepped and the file name is printed to the console.