MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C# lib to read and write ID3 tags of MP3 files

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp
Author Message
Veerle



Joined: 08 Aug 2007
Posts: 3

PostPosted: Mon Dec 10, 2007 7:36 am    Post subject: C# lib to read and write ID3 tags of MP3 files Reply with quote

Hi,

I haven't been able to find a good tool to modify and manage the ID3
tags of my MP3 files in the way I want, so I decided to write my own
tool. Looking for a free .NET library on the internet to read and
write the ID3 tags v1 and v2 of the MP3 files the choice is rather
limited.

I tried a lot of libraries, but FMod (http://www.fmod.org/index.php/
download) is the first one that is actually able to retrieve all the
ID3 v1 and v2 correctly. It seems to me that the FMod library allows
to modify, delete and add tags as well, but I can't find the correct
method to do so or an example that shows me how to. Has anyone used
this library to add, delete or modify tags of an MP3? Can I get a
piece of sample code?

Perhaps anyone has experience with a good libary to read and write MP3
tags (both ID3 v1 and v2)? An not only the text tags but also for
example the image tag. Something that works well on Windows Vista in
C# .NET 2.0?

Thanks a lot in advance.
Veerle

Archived from group: microsoft>public>dotnet>languages>csharp
Back to top
View user's profile Send private message
Kerem Gümrükcü



Joined: 08 Aug 2007
Posts: 27

PostPosted: Mon Dec 10, 2007 4:33 pm    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Veerle" schrieb im Newsbeitrag@i29g2000prf.googlegroups.com...
> Hi,
>
> I haven't been able to find a good tool to modify and manage the ID3
> tags of my MP3 files in the way I want, so I decided to write my own
> tool. Looking for a free .NET library on the internet to read and
> write the ID3 tags v1 and v2 of the MP3 files the choice is rather
> limited.
>
> I tried a lot of libraries, but FMod (http://www.fmod.org/index.php/
> download) is the first one that is actually able to retrieve all the
> ID3 v1 and v2 correctly. It seems to me that the FMod library allows
> to modify, delete and add tags as well, but I can't find the correct
> method to do so or an example that shows me how to. Has anyone used
> this library to add, delete or modify tags of an MP3? Can I get a
> piece of sample code?
>
> Perhaps anyone has experience with a good libary to read and write MP3
> tags (both ID3 v1 and v2)? An not only the text tags but also for
> example the image tag. Something that works well on Windows Vista in
> C# .NET 2.0?
>
> Thanks a lot in advance.
> Veerle
Back to top
View user's profile Send private message
Kerem Gümrükcü



Joined: 08 Aug 2007
Posts: 27

PostPosted: Mon Dec 10, 2007 4:39 pm    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

Hi Verlee,

sorry for my first post. I hit the Send Button too fast *g*
Try them, they are good, a friend of mine used them once
and he told me that the lib was quiet good. I dont know
if this is till true. See for yourself:

http://home.fuse.net/honnert/hundred/

Regards

Kerem


-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Veerle" schrieb im Newsbeitrag@i29g2000prf.googlegroups.com...
> Hi,
>
> I haven't been able to find a good tool to modify and manage the ID3
> tags of my MP3 files in the way I want, so I decided to write my own
> tool. Looking for a free .NET library on the internet to read and
> write the ID3 tags v1 and v2 of the MP3 files the choice is rather
> limited.
>
> I tried a lot of libraries, but FMod (http://www.fmod.org/index.php/
> download) is the first one that is actually able to retrieve all the
> ID3 v1 and v2 correctly. It seems to me that the FMod library allows
> to modify, delete and add tags as well, but I can't find the correct
> method to do so or an example that shows me how to. Has anyone used
> this library to add, delete or modify tags of an MP3? Can I get a
> piece of sample code?
>
> Perhaps anyone has experience with a good libary to read and write MP3
> tags (both ID3 v1 and v2)? An not only the text tags but also for
> example the image tag. Something that works well on Windows Vista in
> C# .NET 2.0?
>
> Thanks a lot in advance.
> Veerle
Back to top
View user's profile Send private message
eps



Joined: 11 Aug 2007
Posts: 4

PostPosted: Mon Dec 10, 2007 6:28 pm    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

Kerem Gümrükcü wrote:
> Hi Verlee,
>
> sorry for my first post. I hit the Send Button too fast *g*
> Try them, they are good, a friend of mine used them once
> and he told me that the lib was quiet good. I dont know
> if this is till true. See for yourself:
>
> http://home.fuse.net/honnert/hundred/
>
> Regards
>
> Kerem

I have used the above and found it had problems reading some tags (other
software such as winamp would read the tags fine).

The best tag library I am aware is taglib-sharp

http://www.taglib-sharp.com/Main_Page

I think it is structured better than the hundred miles library as well.

--
Eps
Back to top
View user's profile Send private message
Veerle



Joined: 08 Aug 2007
Posts: 3

PostPosted: Tue Dec 11, 2007 3:33 am    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

On 10 dec, 14:28, eps wrote:
> The best tag library I am aware is taglib-sharp
>
> http://www.taglib-sharp.com/Main_Page
>
> I think it is structured better than the hundred miles library as well.

So I decided to try taglib sharp first. But the ID3v2 tags "Original
Artist", "URL" and "Encoded" which can be modified in WinAmp appear
not to accesible trough this library? I also can't seem to find the
"classification" tag that appears in iTunes.

Also saving modified tags doesn't work for me. I want to be able to
save the ID3v1 and ID3v2 tags seperately, so I wrote the code beneath.
Any idea what I do wrong and how I can save this tags seperatly?

// Get file
TagLib.File file = TagLib.File.Create(fileName);

// Clear ID3v1tags
TagLib.Id3v1.Tag id3v1Tag = file.GetTag(TagLib.TagTypes.Id3v1) as
TagLib.Id3v1.Tag;
id3v1Tag.Title = null;
id3v1Tag.Performers = new string[0];
id3v1Tag.Album = null;
id3v1Tag.Year = 0;
id3v1Tag.Comment = null;
id3v1Tag.Track = 0;
id3v1Tag.TrackCount = 0;
id3v1Tag.Genres = new string[0];

// Set ID3v2 tag values
TagLib.Id3v2.Tag id3v2Tag = file.GetTag(TagLib.TagTypes.Id3v2) as
TagLib.Id3v2.Tag;
id3v2Tag.Title = "something";
id3v2Tag.Performers = new string[] { "something" };
id3v2Tag.Album = "something";
id3v2Tag.Year = 2007;
id3v2Tag.Track = 1;
id3v2Tag.TrackCount = 10;
id3v2Tag.Genres = new string[] { "Pop" };
id3v2Tag.Disc = 1;
id3v2Tag.Comment = "something";
id3v2Tag.AlbumArtists = new string[0]; ;
id3v2Tag.Composers = new string[0]; ;
id3v2Tag.Copyright = "something";

// Save
file.Save();
Back to top
View user's profile Send private message
eps



Joined: 11 Aug 2007
Posts: 4

PostPosted: Wed Dec 12, 2007 5:19 pm    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

Veerle wrote:

> Also saving modified tags doesn't work for me. I want to be able to
> save the ID3v1 and ID3v2 tags seperately, so I wrote the code beneath.
> Any idea what I do wrong and how I can save this tags seperatly?
>
> // Get file
> TagLib.File file = TagLib.File.Create(fileName);

Do you get an excpetion or an error message ?, to be honest you are
better off posting this in the taglibsharp forum than here.

--
Eps
Back to top
View user's profile Send private message
Veerle



Joined: 08 Aug 2007
Posts: 3

PostPosted: Thu Dec 13, 2007 3:13 am    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

On 12 dec, 13:19, eps wrote:
> Do you get an excpetion or an error message ?, to be honest you are
> better off posting this in the taglibsharp forum than here.

I don't get an error message or exception. I will post it in the
taglibsharp forum.

I tried the Hundred Miles library too, but it doesn't read some ID3v2
tags correctly. In Winamp I see ID3v2 tags for some mp3s, but Hundred
Miles acts like these tags are not filled in. This is probably because
they only support ID3v23 and not the other versions of ID3v2, I guess.

I also tried C# ID3 Library (http://sourceforge.net/project/
showfiles.php?group_id=89188&package_id=93467&release_id=186994). This
seems great with ID3v2 but it doesn't read the ID3v1 tags correctly
allthough they provide methods and classes to retrieve this data as
well.

Anyone tried accessing the WinAmp or iTunes dlls that come with
installation through C#? Or anyone have another suggestion for a good
library?
Back to top
View user's profile Send private message
eps



Joined: 11 Aug 2007
Posts: 4

PostPosted: Thu Dec 13, 2007 6:26 pm    Post subject: Re: C# lib to read and write ID3 tags of MP3 files Reply with quote

Veerle wrote:

> Anyone tried accessing the WinAmp or iTunes dlls that come with
> installation through C#? Or anyone have another suggestion for a good
> library?
>

I have not tried using dll's provided by winamp or itunes, unless they
support com interop I would have no idea how to access them from .net

I tried loads of id3tag libraries, the only two that were usable for my
purposes were taglib-sharp and the hundredmiles one. taglib-sharp is
still being actively developed I believe whereas the hundredmiles
library was last updated in 2006. For me the taglib-sharp is pretty
much flawless, but I am not particularly fussy about the specific types
of my tags.

--
Eps

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Can't read/write to Registry Why I always get 'Requested registry access is not allowed' when i try to Read/Write to Windows Registry from ASP service. I use ASP NET account? Also granted full permissions to required Registry keys. What is the problem? TIA

Read and write to Console or a file How come line 1 will output garbage to the screen, but line 2 will output a good number to a file? How can I make line 1 out put a good number to the screen String* dayStr = Int32 dayInt =

Read Write File on Workgroup Server Hi, This is a strange one, but its the constraint I have to work in. A web page modifies an xml Document, the trouble is that the document is on a work group and not in our domain. if i login to the server via windows login popup whilst accessing the remo

using IRedbookDiscMaster to write protected audio files to C Hi, I am trying to write WMRM protected file to CD using interface, song has proper license, but I am able to open the song for writing. I tried to use the same code for un-protected song file, there I am able to write to the CD but it

Using XPath to read VS 2005 csproj files I am loading a VS2005 csproj file into an XPathDocument then am creating an I am trying to use XPath to pull the Include attributes from the Element of the ItemGroup Element. For some reason I cannot get the XPath syntax
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group