ID3-DotNetCore is an effort to port the ID3.NET library to .NET Core.
ID3.NET is a set of libraries for reading, modifying and writing ID3 and Lyrics3 tags in MP3 audio files.
This version of the core library currently supports .NET Core 1.1 and 2.0, as well as .NET Standard 1.3 and 2.0.
NOTE - The code in this repo has not been thoroughly tested. I essentially took the original source code, created new project files, fixed some dependencies, and packaged it up. I did port the unit tests, but none of the test MP3 files were in the original developer's repo...so I can't run them at the moment.
The original version of ID3.NET supported multiple extensions, but as of right now, only the ID3.File extension has been ported.
Since the original library was written back in 2002, I assumed the metadata library was heavily out of date, and would need some serious refactoring.
Also, .NET Core's binary serialization support is significantly different from the full framework, so I didn't port the Serialization extension. When/If I have the time, I'll look at porting the code to use MessagePack, but if anyone feels ambitious, I'll accept a pull request. :-)
Install the Nuget package via Package Manager Console:
Install-Package ID3.Net-DotNetCore
If you want to use the ID3.Files package:
Install-Package ID3.Files-DotNetCore
using System;
namespace Example
{
class Program
{
public static void Main(string[] args)
{
var musicFiles = Directory.GetFiles(@"C:\Music", "*.mp3");
foreach (string musicFile in musicFiles)
{
using (var mp3 = new Mp3File(musicFile))
{
Id3Tag tag = mp3.GetTag(Id3TagFamily.Version2x);
Console.WriteLine("Title: {0}", tag.Title.Value);
Console.WriteLine("Artist: {0}", tag.Artists.Value);
Console.WriteLine("Album: {0}", tag.Album.Value);
}
}
}
}
}