You can create simple ID3v2 tags in NAudio by constructing a dictionary of IDs (4 character strings) and values. Here’s a simple example:
Dictionary<string, string> tags = new Dictionary<string, string> { { "TIT2", "Song title" }, { "TPE1", "Artist name" }, { "TYER", "2012" }, /* year of the song */ { "COMM", "Extra comment info" }, { "TCON", "(110)Satire" } /* genre */ }; var tag = Id3v2Tag.Create(tags);
And then you can write this to your MP3 Stream (usually a FileStream) using the RawData property:
output.Write(tag.RawData, 0, tag.RawData.Length);