2
votes

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.

3

3 Answers

4
votes

Taglib has Ruby bindings and does what you want.

2
votes

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

1
votes

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.