NTagLib
A C++/CLI assembly for tagging audio files with TagLib in managed code
Install / Use
/learn @luminescence-software/NTagLibREADME
NTagLib
NTagLib is a 64 bits C++/CLI library for tagging audio files with TagLib in managed code.
NTagLib requires the Visual C++ 2022 runtime (x64).
This library has been designed to be used with my tags editor, Metatogger.
Here is a screenshot of that software:

Feel free to fork the code and contribute to NTagLib.
How to use the tagging API in C♯
using NTagLib;
// supports the following audio formats: MP3 (*.mp3), FLAC (*.flac), Opus (*.opus), Ogg Vorbis (*.ogg), WMA (*.wma) and AAC/ALAC (*.m4a)
var tagger = new TaglibTagger(@"C:\MyFolder\MyAudioFile.flac");
// getting technical informations
string codecName = tagger.Codec; // "FLAC"
string codecVersion = tagger.CodecVersion; // "1.2.1"
int channelsCount = tagger.Channels; // 2
TimeSpan duration = tagger.Duration; // 0:05:23
int sampleRateInHertz = tagger.SampleRate; // 44100
int bitsPerSample = tagger.BitsPerSample; // 16
// getting or setting textual tags
// textual tags is stored in a dictionary where the key is the tag name in uppercase
Dictionary<string, List<string>> tagsRepository = tagger.Tags;
string? artist = tagger.GetTagValues(TagNameKey.Artist).FirstOrDefault();
tagger.AddTag(TagNameKey.Artist, "Artist 2", "Artist 3");
tagger.ReplaceTag(TagNameKey.Title, "All You Need Is Love");
tagger.RemoveTag(TagNameKey.Comment);
tagger.AddTag("MY_KEY_NAME", "Custom Tag Value");
// getting or setting embedded covers
List<Picture> pictures = tagger.Pictures;
if (pictures.Count != 0)
{
Picture? mainPicture = pictures.FirstOrDefault(p => p.PictureType == PictureTypes.FrontCover);
if (mainPicture == null) mainPicture = pictures[0];
byte[] data = mainPicture.Data;
string pictureMime = mainPicture.MimeType; // "image/jpeg"
}
pictures.Clear();
byte[] bytes = File.ReadAllBytes(@"C:\MyFolder\MyCover.jpg");
pictures.Add(new Picture(bytes, MimeTypes.JPEG, PictureTypes.FrontCover, String.Empty));
tagger.Save(); // save changes
Licence
NTagLib is distributed under the same licensing conditions as TagLib.
Sylvain Rougeaux (Cyber Sinh)
Related Skills
docs-writer
99.2k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
337.4kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
ddd
Guía de Principios DDD para el Proyecto > 📚 Documento Complementario : Este documento define los principios y reglas de DDD. Para ver templates de código, ejemplos detallados y guías paso
arscontexta
2.9kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
