Question

I always used third party CLI apps to manage my collection of music, now I want to manage my collection coding by myself all what I need to do using libraries ...but I'm not an expert in this programming music things.

I need a ID3 library (of course I want the best!) to delete (not write) all ID3v1 and ID3v2 tags of all the mp3 files, I've seen id3lib but it's for c++ so I've decided to try UltraId3Lib which is for .NET, the lib is full object-oriented, easy to use, and seems very efficient ...but also seems a little bit outdated: http://home.fuse.net/honnert/UltraID3Lib/

My first question is if the library that I've choosed is good and efficient or maybe exist a better ID3 Library for .NET (and easy to use, remember I'm not an expert of mp3 headers and that things).

My second and most important question is if I can corrupt/damage a mp3 file when trying to delete the id3v1+id3v2 tags from the file (I don't mean a human-error), and if yes then which are the reasons that can corrupt the mp3 audio data? or maybe I don't have to worry about the "bytes space" where the ID3 tags will be written/deleted?

...Or in other words to ask the same: An ID3v1/ID3v2 tag can corrupt a mp3 file? if yes then why? in which circunstances?

Was it helpful?

Solution

First Answer: I suggest using 'TagLib-Sharp' as ID3 library for .NET

Second Answer: As long as you use a well known ID3 library, your risk to damage the music file is very low. But (as always and with every software) it is not zero. Therefore I would recommend to test your own application with *.mp3 files which you have backuped before.

You could also have the situation, where the ID3 tags have been written to the files not following the specifications from ID3.org. Then the risk to damage the files will be higher. In such rare cases, you have three options:
a) Restore it from backup
b) Rip them again from your original source (CD, LP, Cassette)
c) Download it again from your official market place (Amazon, iTunes etc).

Following the ID3 specifications the ID3v1/ID3v2 Tag is saved in the first bytes before or at the end after the "music data part" of your mp3 files. As long as you delete only this start/end-part, you will not damage your song part.

OTHER TIPS

Well I'm not sure about how easy it is to corrupt a mp3 file when removing tags, but there is a post on how to strip out the tags manually (in code).

But if you want to use a library there's always TagLib-Sharp.

Use the RemoveTags() method.

file.RemoveTags(tagtypes);

Where tagtypes is a TagType bitmask for the tags you want to remove. For Id3v1 and Id3v2, try,

file.RemoveTags(TagTypes.Id3v1 && TagTypes.Id3v2);

Taken from this post.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top