I'm trying to organized music for a radio station and have an iTunes library with a huge number of music files. The files are in various formats (Flac, MP3, AAC, etc.). I need to break all the files up by format.
I have a simple Ruby script that walks the directory tree and can pull by extension, so I can move all .mp3 files into an MP3 directory. However, I have a problem with m4a files, because some .m4a files are Apple Lossless format and some are Apple's AAC format.
The problem I have is that the MP4Info gem seems only to have "Encoder," which returns something like iTunes 9.0.2, which is not helpful in determining lossless vs lossy formatting.
So, my thought is to take the SIZE attribute of the file and divide that by the SECS attribute. It seems that I should be able to come up with a decent rubric for bytes/second in a lossless vs a lossy format, since they will be roughly an order of magnitude off. I'm not sure what order of magnitude I'm looking for (it depends on bitrate, I'd guess).
Are there better, easier ways to do this?