EasyTag is an abstract interface to the TagLib audio tagging library. It is designed to provide a simple and consistent API regardless of file format being read.
A quick reference to which attributes are currently supported can be found here.
Synopsis
require 'easytag'
mp3 = EasyTag::File.new("01 Shout Out Loud.mp3")
# easy access to attributes
mp3.title
# => "Shout Out Loud"
mp3.artist
# => "Amos Lee"
mp3.year
# => 2006
mp3.date
# => #<DateTime: 2006-10-03T00:00:00+00:00 ((2454012j,0s,0n),+0s,2299161j)>
mp3.album_art
# => [#<EasyTag::Image:0x007f7fa542f528>]
# get access to the taglib-powered backend
mp3.info
# => #<TagLib::MPEG::File:0x007f7fa539e050 @__swigtype__="_p_TagLib__MPEG__File">
mp3.close
# A block interface is also available
EasyTag::File.open('01 Shout Out Loud.m4a') do |m4a|
puts m4a.title
puts m4a.comments
puts m4a.genre
end
Requirements
- Ruby versions
- 1.9
- 2.0
- Dependencies
- TagLib (1.8+)
- taglib-ruby (0.6.0+)
- ruby-mp3info
- ruby-imagespec
TODO
- API Documentation
- FLAC and OGG support
- Write support