MP3 Tags

PlausiblyDamp

Administrator
Joined
Sep 4, 2002
Messages
6,155
Location
Lancashire, UK
User Rank
*Expert*
Result of being bored in a hotel a few nights ago. Fairly rough and ready (only took a few hours and several guiness to throw together) but should handle ID3 v1 tags fine.
Supports ID3 v2 tags more or less : Provides property access for the more common tags but should read and write all tags. Text based tags are untested with anything but ASCII content.
Error handling may be a bit lacking feel free to PM me with any critical problems and Ill try to find time to fix them ;)

Can be used something like
C#:
MP3TagLibrary.ID3v2Tag test = new MP3TagLibrary.ID3v2Tag(<Path to file here>);
MessageBox.Show(test.Artist);	//should display artist
test.Artist= "This will overwrite the real tag - be careful";
test.Update();	//save changes back.

Includes a basic user interface to manipulate tags. As per usual code is provided with no guarantees at all.
EDIT: this version appears to work better
 

Attachments

Last edited by a moderator:
I was never really satisfied with the above code as it was very rushed and as already stated written with much Guiness being consumed, however it met my needs at the time...

After reading Test-Driven Development in Microsoft .NET as recomended by our own Nerseus I felt it was a good a topic as any to try and put the techniques into practice.

So far it only supports v1 and v1.1 tags (2.0 is a big leap forward - but may happen in the future). The library is written in C# as are the included tests, there is also a very basic UI written in VB.Net (I didnt realise I was using VB until I had pretty much finished the front end and couldnt be bothered doing it again in C#...)

If you want to run the tests yourself you will need to obtain a copy of NUnit and the test mp3s can be obtained Here.

In a debug release it will compile as is, to do a release build you need to provide a strong name key file - path is in the assemblyinfo.cs. If you use the link to the above test files you can edit the path to them in the MP3TagTests.config file.

I do intend to continue developing this to support v2 tags but will probably continue development with VS 2005 as this will allow me to take advantage of generics to manange collections of frame types and also an easier time with the improved IDE (refactoring and intellisense improvements).
 

Attachments

Back
Top