如何在C#中读写ID3标签到MP3?

时间:2023-01-24 11:55:52

Is there a library for reading and writing ID3 tags to an MP3 in C#?

是否有用于在C#中读取和写入ID3标签的库?

I've actually seen a couple when searching, anybody using any that can be recommended?

我实际上在搜索时看过一对,有人使用任何可以推荐的吗?

4 个解决方案

#1


36  

Taglib# is the best. It's direct port of the TagLib C library to C#.

Taglib#是最好的。它是TagLib C库到C#的直接端口。

To install TagLib#, run the following command in the Package Manager Console in Visual Studio.

要安装TagLib#,请在Visual Studio的程序包管理器控制台中运行以下命令。

PM> Install-Package taglib

The NuGet distribution of taglib-sharp can be found at http://nuget.org/packages/taglib.
The official source code repository is at https://github.com/mono/taglib-sharp.

可以在http://nuget.org/packages/taglib找到taglib-sharp的NuGet分布。官方源代码存储库位于https://github.com/mono/taglib-sharp。

Here's an example using the library:

以下是使用该库的示例:

TagLib.File file = TagLib.File.Create("mysong.mp3");
String title = file.Tag.Title;
String album = file.Tag.Album;
String length = file.Properties.Duration.ToString();

#2


5  

I've personally used ID3.Net from here:

我个人从这里使用了ID3.Net:

http://id3dotnet.sourceforge.net/

http://id3dotnet.sourceforge.net/

As well as UltraID3Lib from here:

和UltraID3Lib一样:

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

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

Both did the job well and were easy to use from an API standpoint.

两者都做得很好,从API的角度来看也很容易使用。

#3


0  

Here's a sourceforge project that's been written to do this and seems to have some good reviews:

这是一个源代码项目,这是为了做到这一点而写的,似乎有一些很好的评论:

http://csid3lib.sourceforge.net/

http://csid3lib.sourceforge.net/

I've only ever read ID3 tags, never written them, so I can't comment specifically on that. However, I believe this project (in a much earlier stage) was what I used to do it.

我只读过ID3标签,从来没有写过它们,所以我不能专门评论它。但是,我相信这个项目(在更早的阶段)是我以前做的。

#4


0  

Also: http://id3tag.codeplex.com/

另外:http://id3tag.codeplex.com/

#1


36  

Taglib# is the best. It's direct port of the TagLib C library to C#.

Taglib#是最好的。它是TagLib C库到C#的直接端口。

To install TagLib#, run the following command in the Package Manager Console in Visual Studio.

要安装TagLib#,请在Visual Studio的程序包管理器控制台中运行以下命令。

PM> Install-Package taglib

The NuGet distribution of taglib-sharp can be found at http://nuget.org/packages/taglib.
The official source code repository is at https://github.com/mono/taglib-sharp.

可以在http://nuget.org/packages/taglib找到taglib-sharp的NuGet分布。官方源代码存储库位于https://github.com/mono/taglib-sharp。

Here's an example using the library:

以下是使用该库的示例:

TagLib.File file = TagLib.File.Create("mysong.mp3");
String title = file.Tag.Title;
String album = file.Tag.Album;
String length = file.Properties.Duration.ToString();

#2


5  

I've personally used ID3.Net from here:

我个人从这里使用了ID3.Net:

http://id3dotnet.sourceforge.net/

http://id3dotnet.sourceforge.net/

As well as UltraID3Lib from here:

和UltraID3Lib一样:

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

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

Both did the job well and were easy to use from an API standpoint.

两者都做得很好,从API的角度来看也很容易使用。

#3


0  

Here's a sourceforge project that's been written to do this and seems to have some good reviews:

这是一个源代码项目,这是为了做到这一点而写的,似乎有一些很好的评论:

http://csid3lib.sourceforge.net/

http://csid3lib.sourceforge.net/

I've only ever read ID3 tags, never written them, so I can't comment specifically on that. However, I believe this project (in a much earlier stage) was what I used to do it.

我只读过ID3标签,从来没有写过它们,所以我不能专门评论它。但是,我相信这个项目(在更早的阶段)是我以前做的。

#4


0  

Also: http://id3tag.codeplex.com/

另外:http://id3tag.codeplex.com/