<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8334277\x26blogName\x3dSriram\x27s+Blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://metallicatony.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://metallicatony.blogspot.com/\x26vt\x3d6147907796332168684', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Monday, March 23, 2009

id3v2 vs iTunes

I had a bunch of mp3 files from various artists whose id3 tags were not properly set. Read again, the mp3 files are lying in the same folder. They belong to different artists and come from different albums. The only advantage i had was the file name of every mp3 file had the Artist name followed by - and followed by Title name followed by .mp3. There was no way i can find a GUI tool (lame closed source iTunes! Don't hide! Reveal yourself!) using which i can easily pick the artist name & album name from the file name and set it in the id3 tag of that file. I had to do this manually scrolling through every single file to set the tags in iTunes or in any other tag editing tool. That was time drenching. I had a long way to go too - because i had 500 such untagged mp3s. So, i dropped this boring work and started thinking to write a script to do this.

After exploring various id3 libraries available under Linux, I decided that MP3::Tag CPAN Perl module will suit my need. As Perl is good at text manipulation, its easy to use regex and cut the artist names and title names of every file from its file name. And MP3::Tag module (supports both id3v1 and id3v2) can be used to set the cut values into the tag of mp3 file. Perl did its job perfectly. Hurray!

Only after completing, I realized there is a command line tool called id3v2 in Linux which i could have incorporated in my script instead of using MP3::Tag library for reading and setting tag values. Things would have been much easier if i had used id3v2 tool. id3v2 is such a swift command line tool that operates with so ease. No need of right clicking a bunch of files in iTunes and waiting for the window to pop up. Then editing and saving. Phew! I would say that's a novice way.

Use id3v2 and tag all mp3s at one strike of your enter key! Be happy!

iTunes SDK with its documentation is given for free download in Apple site. (I will never ever suggest anyone to try to use it). Because see here. This is from my iPod. This is how iTunes stores mp3s and related information in iPod with a hidden format under hidden directories.



Apple calls it as "Protecting DRM"! Its just a way to convince and tie up with major music distributors (causing incovenience to users like me without having open standards) so that Apple can earn more.

Labels:

0 Comments:

Post a Comment

<< Home