views:

356

answers:

3

I need to read metadata (song name, artist, etc.) from various audio files with ruby, mainly MP3 and Apple's AAC. I've googled and found no library that supported both formats.

How do you guys read audio metadata with ruby? I would prefer a solution with minimal dependencies possible.

Thanks.

+1  A: 

There is id3lib-ruby gem, but I had some issue with this and some specific MP3s, some worked, some crashed the app entirely. But if you can get it to work, it's nice.

This RubyQuiz http://rubyquiz.com/quiz136.html might help you get started if you want to write your own simple parser.

nowk
That library would be perfect if it supported AAC audio files. But unfortunately that's not the case :\
rogeriopvl
+2  A: 

AAC files are standard QuickTime files with everything stored as Atoms which can be parsed if you can read the raw byte stream.

lucius
+1  A: 

Taglib has Ruby bindings and does what you want.

dmazzoni