Was listening to music and thought of changing the mp3 tags. Quickly i opened the file and right clicked to change it, but unfortunately i couldn't. So i thought of building a small application which will help to me to play with these tags.
I searched for some helpers in ruby and came to know about "RUBY-MP3INFO" which will help you to read, write, remove id3v1 and id3v2 tags.You can easily do this in few steps.
Installation
$ ruby install.rb config
$ ruby install.rb setup
ruby install.rb install
Or simply
gem install ruby-mp3info
Documentation is available at http://ruby-mp3info.rubyforge.org/
We knows the tags now with the help of documentation . Using some simple coding we can access this tags , the following code fragments will help to do the rest.
Dispaly all tags
run as ./mp3tags.rb -tags <mp3filename>
; , which will give u that tags of that mp3 file
Now we can expand this code to insert our own tags.
run ./change_tag.rb -s <field> <fieldname> <mp3 filename>
; it will help u to change the <field> of <filename> with <fieldname>
After doing these i thought of giving a directory as input and want to change the field of all the files insidfe that directory.For doing that FileTest.directory?(arg) in ruby helped to find out whether the passed argument is a file or directory.
run ./directory.rb -dir <field> <fieldname> <directoryname>
; which will change the field of all files inside the directory name with given fieldname
Atlast I integerated all these together which which perfectly working and giving you access to read, write, remove id3v1 and id3v2 tags
run /change_tags.rb
with respective field
Fianlly we can play with tags of mp3 files. Also we can apply "Tk" tool of our Ruby and we can have a GUI for dispalying the tags and editing fields.If you installed Ruby yourself, possibly the Tk bindings do not work , so make sure that by requiring Tk on irb
irb>>require("tk")
true
irb>>
Or u can easily install this by
sudo apt-get install libtcltk-ruby
Hope this will help u and make a try out of this :)