Ruby library for reading and writing meta-data (tags) of many audio formats
It’s based on the excellent TagLib C++ library, which is fast, full-featured and mature.
In contrast to other bindings, this one wraps the full C++ API, not only the minimal C API. This means that all tag data can be accessed, e.g. cover art of ID3v2 or custom fields of Ogg Vorbis comments.
taglib-ruby currently supports reading and writing of:
It also supports reading audio properties (e.g. bitrate) of the above formats.
Before you install the gem, you need to have taglib installed with header files (and a C++ compiler):
Debian/Ubuntu | sudo apt-get install libtag1-dev |
Fedora/RHEL | sudo dnf install taglib-devel |
Homebrew | brew install taglib |
Windows users on Ruby 1.9 don't need that, because there is a pre-compiled binary gem available which bundles taglib.
Then install taglib-ruby (or add it to your Gemfile):
gem install taglib-ruby
There’s a basic API and format-specific APIs.
The basic API can read all formats that TagLib supports and is easy to use. On the other hand, it only exposes some basic meta-data that is the same across all formats. Here’s an example:
For each format, there’s also an advanced API. It enables doing format-specific things. In the example, we’re reading ID3v2 frames and extract the attached picture from an ID3v2 tag:
For more information please have a look at the complete documentation.