Id3lib-ruby 0.1.0 (first release)

Hi,

I’m glad to announce the first release of id3lib-ruby. It’s a project I
started some time ago and thought someone else may find useful, so here
it is :slight_smile:

http://id3lib-ruby.rubyforge.org/

== Description

id3lib-ruby provides a Ruby interface to the id3lib C++ library for
easily editing ID3 tags (v1 and v2) like with pyid3lib. Because the
extension is based on SWIG, already most of the features of id3lib are
implemented.

== Features

  • Read and write ID3v1 or ID3v2 tags
  • Simple interface for adding, changing and removing frames
  • Quick access to common text frames like title and performer
  • Custom data frames like attached picture (APIC)
  • Pretty complete coverage of id3lib’s features
  • UTF-16 support

== Installation

Installation through Rubygems:

gem install id3lib-ruby

Note that you need to have id3lib installed as id3lib-ruby is only a
wrapper library.

== Usage

require ‘rubygems’
require ‘id3lib’

Load a tag from a file

tag = ID3Lib::Tag.new(‘talk.mp3’)

Get and set text frames with convenience methods

tag.title #=> “Talk”
tag.album = ‘X&Y’
tag.track = ‘5/13’

Tag is a subclass of Array and each frame is a Hash

tag[0]
#=> { :id => :TPE1, :textenc => 0, :text => “Coldplay” }

Get the number of frames

tag.length #=> 7

Remove all comment frames

tag.delete_if{ |frame| frame[:id] == :COMM }

Add an attached picture frame

cover = {
:id => :APIC,
:mimetype => ‘image/jpeg’,
:picturetype => 3,
:description => ‘A pretty picture’,
:textenc => 0,
:data => File.read(‘cover.jpg’)
}
tag << cover

Last but not least, apply changes

tag.update!

== Planned

  • win32 binary gem (with id3lib included)

Cheers,
Robin S.

Thanks Robin, it looks great!

Cheers,
Daniel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs