# \[ANN\] id3lib-ruby 0.1.0 (first release)

**URL:** <https://rubytalk.org/t/ann-id3lib-ruby-0-1-0-first-release/26911>\
**Category:** ruby-talk\
**Created:** [24 April 2006 20:05 UTC](https://rubytalk.org/t/ann-id3lib-ruby-0-1-0-first-release/26911 "2006-04-24T20:05:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Stocker1](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@Robin\_Stocker1](https://rubytalk.org/u/Robin_Stocker1)\
**Post date:** [24 April 2006 20:05 UTC](https://rubytalk.org/t/ann-id3lib-ruby-0-1-0-first-release/26911/1 "2006-04-24T20:05:10Z")

</div>

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 🙂

[http://id3lib-ruby.rubyforge.org/](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:

&nbsp;&nbsp;&nbsp;gem install id3lib-ruby

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

== Usage

&nbsp;&nbsp;&nbsp;require 'rubygems'  
&nbsp;&nbsp;&nbsp;require 'id3lib'

&nbsp;&nbsp;&nbsp;# Load a tag from a file  
&nbsp;&nbsp;&nbsp;tag = ID3Lib::Tag.new('talk.mp3')

&nbsp;&nbsp;&nbsp;# Get and set text frames with convenience methods  
&nbsp;&nbsp;&nbsp;tag.title #=\> "Talk"  
&nbsp;&nbsp;&nbsp;tag.album = 'X&Y'  
&nbsp;&nbsp;&nbsp;tag.track = '5/13'

&nbsp;&nbsp;&nbsp;# Tag is a subclass of Array and each frame is a Hash  
&nbsp;&nbsp;&nbsp;tag[0]  
&nbsp;&nbsp;&nbsp;#=\> { :id =\> :TPE1, :textenc =\> 0, :text =\> "Coldplay" }

&nbsp;&nbsp;&nbsp;# Get the number of frames  
&nbsp;&nbsp;&nbsp;tag.length #=\> 7

&nbsp;&nbsp;&nbsp;# Remove all comment frames  
&nbsp;&nbsp;&nbsp;tag.delete\_if{ |frame| frame[:id] == :COMM }

&nbsp;&nbsp;&nbsp;# Add an attached picture frame  
&nbsp;&nbsp;&nbsp;cover = {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:id =\> :APIC,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:mimetype =\> 'image/jpeg',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:picturetype =\> 3,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:description =\> 'A pretty picture',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:textenc =\> 0,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:data =\> File.read('cover.jpg')  
&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;tag \<\< cover

&nbsp;&nbsp;&nbsp;# Last but not least, apply changes  
&nbsp;&nbsp;&nbsp;tag.update!

== Planned

\* win32 binary gem (with id3lib included)

Cheers,  
&nbsp;&nbsp;&nbsp;Robin Stocker

---

<div class="post-metadata">

**Author:** ![Daniel\_Schierbeck](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daniel\_Schierbeck](https://rubytalk.org/u/Daniel_Schierbeck)\
**Post date:** [25 April 2006 16:43 UTC](https://rubytalk.org/t/ann-id3lib-ruby-0-1-0-first-release/26911/2 "2006-04-25T16:43:06Z")

</div>

Thanks Robin, it looks great!

Cheers,  
Daniel
