How do I programtically access and modify music metadata entries through iTunes?
April 7, 2006 6:40 AM
Subscribe
Has anyone ever managed to use iTunes and COM to access the iTunes database and modify MP3 meta-data tags? I need to change the genre for every track by a certain artist and since I have a list of over 800 artists, it is not something I can do by hand.
Genres in my iTunes database (and MP3's) are a mess and so I've decided to try and fix it.
Following some simple coding, I've managed to work out what the most common genre entry in the FreeDB database is for many of the artists in my collection and I'm going to populate every song by that artist with this new genre. For example the most common entry in FreeDB for "Faithless" is "Dance" and for "Groove Armada" is "Lounge". I know this isn't a perfect solution, but it is better than the mess I currently have.
So I have a tab seperated file which contains artist name and genre and what I plan to do is walk through the entire iTunes database looking at the artist for each song. If I find an artist that matches one in my tab seperated file then I'll "correct" the genre entry in iTunes to be the same as that in the text file.
Herein lies the problem. Having looked at the iTunes documentation I haven't a clue how to:
1. Walk through every single song from within iTunes
2. Extract the artist value from that song
3. Write the genre value to that entry (which I assume will also update the ID3 v1 and v2 tag on the actual file, right?)
4. Exit modifications and the database without corrupting anything.
I'm using Visual Basic to perform this. Searching on the web has found me very little so I'm looking to see if anyone on AskMefi has any ideas.
posted by mr_silver to computers & internet (13 comments total)
posted by dudeman at 6:51 AM on April 7, 2006