Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

id3lib-ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

id3lib-ruby

  • 0.6.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= id3lib-ruby

id3lib-ruby provides a Ruby interface to the id3lib C++ library for easily editing ID3 tags (v1 and v2) of MP3 audio files.

The class documentation starts at ID3Lib::Tag.

== Features

  • Read and write ID3v1 and 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 (warning: id3lib writes broken UTF-16 frames)
  • Windows binary gem available

The CHANGES file contains a list of changes between versions.

== Installation

See INSTALL.

== Online Information

The home of id3lib-ruby is http://id3lib-ruby.rubyforge.org

== 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 }

Get info about APIC frame to see which fields are allowed

ID3Lib::Info.frame(:APIC) #=> [ 2, :APIC, "Attached picture", #=> [:textenc, :mimetype, :picturetype, :description, :data] ]

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!

== Licence

This library has Ruby's licence:

http://www.ruby-lang.org/en/LICENSE.txt

== Author

Robin Stocker

FAQs

Package last updated on 16 May 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc