Apple Script or Automator to locate music files at lower sample rates using afinfo tool?
Hello,
I have a number of folders with music files I had losslessly encoded from music CDs to FLAC files. I did them mostly at a sample rate of 192 kHz (192000 Hz), but I think I had done some early ones at a lower sample size. Is it possible to have a script that will recursively go through the folders and output (to a text file) a list of files (with path) that have a sample rate of anything that is not 192 kHz?
Finder displays the sample rate under "More Info" in the Get Info dialog for the file, so OSX should have a way to read it.
EDIT: From Google, it looks like OSX has a command-line tool called afinfo that can get this info.
If I use afinfo -b filename, I get this:
afinfo -b 03.flac
03.flac, flac, Num Tracks: 1
----
236.758 sec, format: 2 ch, 192000 Hz, flac (0x00000003) from 24-bit source, 4608 frames/packet
If I use afinfo filename |grep "Hz", I get this:
afinfo 03.flac |grep "Hz"
Data format: 2 ch, 192000 Hz, flac (0x00000003) from 24-bit source, 4608 frames/packet
Alternatively, perhaps this tool can help? https://xiph.org/flac/documentation_tools_flac.html
But, whichever way, I would need to do it recursively for a large list of subfolders within a big Music folder.
Thanks!