Last updated on February 11, 2022 by Shoaib Khan
Blog Home

Remove MP3 Tags using C#

Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

MP3 files could contain metadata of various standards. Sometimes you do not require certain metadata information. We can quickly remove these metadata MP3 tags programmatically. In this article, we will discuss how to remove different MP3 tags using C#. Precisely, we will learn to remove ID3v1, ID3v2, Lyrics, and APEv2 metadata tags from the mp3 files within the .NET application.

The following topics are covered below:

  • .NET API to Remove MP3 tags
  • Remove MP3 ID3 Tags – ID3, Lyrics, APE
  • C# Code Example

.NET API for MP3 Tags Removal

GroupDocs.Metadata showcases metadata management .NET API to deal with various file formats within .NET applications. The API allows to read, update, add, clean, and totally remove the metadata for many file formats. We will use this API to remove metadata tags of MP3 files.

You can download the DLLs or MSI installer from the downloads section or install the API in your .NET application via NuGet.

PM> Install-Package GroupDocs.Metadata

Remove MP3 Tags using C# – ID3v1, ID3v2, Lyrics, APE

The following steps will quickly allow you to remove MP3 metadata tags from your MP3 files in C#.

  1. Load the MP3 file.
  2. Get the MP3 root package.
  3. Remove the relevant MP3 Tag(s).
  4. Save the updated MP3 file.

1. Load MP3

Select the MP3 file and load it using the Metadata class.

Metadata metadata = new Metadata("path/mp3File.mp3");

2. Get MP3 Root Package

Get the MP3 Root Package of the MP3 file using the GetRootPackage() method.

var root = metadata.GetRootPackage();

3. Remove MP3 Tags

From the following ways of removing different metadata tags, you can use your relevant removal strategy.

ID3v1

To remove the ID3v1 metadata tags, set the ID3V1 property of the root package as null.

root.ID3V1 = null;

ID3v2

To remove the ID3v2 metadata tags, nullify the ID3V2 property.

root.ID3V2 = null;

Lyrics

Remove the Lyrics tags by setting the Lyrics3V2 property to null.

root.Lyrics3V2 = null;

APE

Use the RemoveApeV2() method of the root package to eliminate APEv2 tags.

root.RemoveApeV2();

4. Save the File

Lastly, save the updated MP3 file using the Save() method.

metadata.Save("path/mp3TagsRemoved.mp3");

Complete Code – Remove

The following source code example shows how to remove relevant MP3 Tags from the MP3 file in C#.

Get a Free API License

You can get a free temporary license to use the API without the evaluation limitations.

Conclusion

To sum up, we learned to remove metadata tags from the MP3 files using C#. We specifically removed ID3v1, ID3v2, Lyrics, and APE tags from the MP3 files. You can learn more about the API from the documentation and contact us for queries via the forum.

See Also

  • Read MP3 Tags using C# – (ID3, Lyrics, APE)
  • Extract RIFF INFO and Metadata of WAV files in C#
  • Manage XMP and EXIF Data of HEIF/HEIC Images using C#

This entry was posted in GroupDocs.Metadata Product Family and tagged Remove APE, Remove Metadata in CSharp, Remove MP3 ID3, Remove MP3 Metadata, Remove MP3 Tags, Remove MP3 Tags in CSharp. .

← Find Homophones in Multiple Files using C#
STL File Viewer using Java →
  • Search

  • Follow Us

    RSS Facebook Twitter YouTube LinkedIn

  • Categories

    • GroupDocs.Total Product Family
      (6)
    • GroupDocs.Viewer Product Family
      (101)
    • GroupDocs.Annotation Product Family
      (72)
    • GroupDocs.Conversion Product Family
      (83)
    • GroupDocs.Comparison Product Family
      (60)
    • GroupDocs.Signature Product Family
      (60)
    • GroupDocs.Assembly Product Family
      (49)
    • GroupDocs.Metadata Product Family
      (70)
    • GroupDocs.Search Product Family
      (45)
    • GroupDocs.Parser Product Family
      (43)
    • GroupDocs.Watermark Product Family
      (36)
    • GroupDocs.Editor Product Family
      (18)
    • GroupDocs.Merger Product Family
      (37)
    • GroupDocs.Redaction Product Family
      (14)
    • GroupDocs.Classification Product Family
      (4)
    • News Release
      (3)