{S.A.Z.W.Q.A}

Entries categorized as ‘ruby’

Winamp: Auto tag feature

March 9, 2008 · 20 Comments

I wanted to blog about this feature from so long (as it got released with Winamp 5.5 a long way back), but I couldn’t find enough time to do this.This weekend however, I had decided to use this feature heavily to tag almost all of my mp3s and hence I decided to blog about it too.

So what I’m talking about ? Auto-tagging in Winamp 5.5

It’s a new feature introduced in Winamp 5.5 that tags your mp3 files using the Gracenote’s CDDB server. It doesn’t relies on any kind of meta-data present in file, neither it does uses the file name for this purpose. I suspect it sends some kind og hash (that I’ll have to hack around …).But what stands out is that Winamp was even able to tag a file name “dsfdsferfermvmev.mp3″ correctly.

Using this feature you can tag and categorize unused songs in your mp3 archieve.

How to find this feature in Winamp:

There are two ways to use this feature:

1. Double click on the scrolling title(or press Alt-3) to open file info dialog, in bottom right you’ll see Auto-tag button (for tagging a single file).

capture_1

2. Create a playlist and select files and then right click on them, select send-to and select Auto-tag (for tagging multiple files in one go).

capture_2

A word of caution:

Nothing is perfect ! so is this. Please keep an eye on the results of the auto-tagging, if you suspect anything wrong don’t apply the tag at all.

Renaming files based on their tags

Now what to do when your files have been tagged, but still their names are like r3rff34f.mp3, well you can use any software available in the market that can rename files based on their tag information or you can use the following ruby-script to rename them.

Click here

Categories: appz · ruby · tagging · winamp

Local variables in Ruby blocks

September 12, 2007 · 1 Comment

One thing while using iterators is that they can use the local variables defined already thereby altering them.

see this code :

a = 10
(1..5).each { |a| p a }
p a   # => 5

see here that although we expected the ‘a’ inside the iterator to be different than the ‘a’ outside yet it modified the outside ‘a’.

Although the same functionality can help you sometimes too.

see this code :

a = 10
(1..5).each { |b| p a+b }
p a

here we are utilizing the fact that we can use local variables inside the iterator and are using them.

Use iterators cautiously !

Categories: ruby