Mp3 Id3 Tag information

Did you ever want to access the ID3 Tags on cli or use that knowledge in a ruby script?

Here is how it works:

#!/usr/bin/ruby

require ‘rubygems’
require ‘mp3info’

puts “Loading file: #{ARGV[0]}:”

begin

Mp3Info.open ARGV[0] do |f|
puts “Artist: \t#{f.tag.artist}”
puts “Title: \t\t#{f.tag.title}”
puts “Album: \t\t#{f.tag.album}”
puts “Tracknum: \t#{f.tag.tracknum}”
puts “Discnum: \t#{f.tag2.TPOS}”
puts “Genre: \t\t#{f.tag.genre_s}”
end

rescue Mp3InfoError
puts “Cannot open file.”
end

20.05.12

Kommentare

Leider gibt es noch keine Kommentare zu diesem Eintrag. Schreibe den ersten!


Einen Kommentar schreiben

You must be logged in to post a comment.