Christian Casutt
Christian Casutt

Reputation: 2423

C# ID3 library that supports custom fields

Currently i'm using TagLib Sharp as suggested in one of the posts @stackoverflow for reading id3-Tag out of mp3, flac, ogg and similar multimedia files .. now i just realized, that id3v2 (maybe even v1) supports custom tags but i can't find the implementation for reading/writing custom tags in TagLib Sharp. Does anybody know of a library that supports custom fields?

Christian

--- Update 20100422 ---

Still searching.. found this page:

http://id3.org/Implementations

Upvotes: 10

Views: 3590

Answers (3)

PeterCo
PeterCo

Reputation: 961

You can try to add a new frame (instead of entire new custom tag). As example, if you want to add a new "Acoustid Duration" TXXX-Frame to an existing *.mp3 file, you can use the taglib-sharp library and something like

Dim MyTaglibMP3 As TagLib.File = TagLib.File.Create("C:\temp\I'm Alive.mp3")
Dim id3v2tag As TagLib.Id3v2.Tag = CType(MyTaglibMP3.GetTag(TagLib.TagTypes.Id3v2), TagLib.Id3v2.Tag)
Dim AcoustidDurationTXXXFrame As New TagLib.Id3v2.UserTextInformationFrame("Acoustid Duration", TagLib.StringType.UTF16)
AcoustidDurationTXXXFrame.Text = {"207"}
id3v2tag.AddFrame(AcoustidDurationTXXXFrame)
...
MyTaglibMP3.Save()
MyTaglibMP3.Dispose()

Of course, this works with every other already defined id3v2 type like "CommentsFrame", "PrivateFrame", "TextInformationFrame" and even "UnsynchronisedLyricsFrame".

If you don't want that the id3v2tag will be encoded with UTF-16, choose another TagLib.StringType

Upvotes: 3

Alireza Noori
Alireza Noori

Reputation: 15243

This article on codeproject has a library that supports any type of tags (including custom tags). I have used it a long time ago but I remember it supports custom tags. But I think TagLib is more robust.

http://www.codeproject.com/KB/cs/Do_Anything_With_ID3.aspx

Upvotes: 1

m1k4
m1k4

Reputation: 829

Have you tried to do it with csid3lib ?

http://sourceforge.net/projects/csid3lib/

Upvotes: 1

Related Questions