Skip to end of metadata
Go to start of metadata
Contents Summary
 

The code sample in below examples uses some methods defined in Working with Common Utilities.

Reading ID3v2 Tag

GroupDocs.Metadata API also supports reading ID3v2 (ID3v2.3 and ID3v2.4) Tag in MP3 format. As ID3v2.2 is obsolete by ID3.org, therefore it is not supported by GroupDocs.Metadata API. To get more information about ID3 tags, visit: https://en.wikipedia.org/wiki/ID3

Reading ID3v2 Tag 

This feature is supported by version 16.11 or greater.

Following are the steps to read the ID3v2 tag in MP3 format.

  1. Initialize Mp3Format
  2. Get ID3v2 tag using Mp3Format.Id3v2 property
  3. If ID3v2 tag is not Null and present then check for all of its properties

 

Reading ID3v2 Tag Using Stream

This feature is supported by version 16.11 or greater.

You can also read ID3v2 Tag using a stream. Following are the steps to read the ID3v2 tag in MP3 format.

  1. Initialize Stream using Stream stream = File.Open(Common.MapSourceFilePath(filePath), FileMode.Open, FileAccess.ReadWrite)
  2. Initialize Mp3Format
  3. Get ID3v2 tag using Mp3Format.Id3v2 property
  4. If ID3v2 tag is not Null and present then check for all of its properties

Reading Additional Properties 

This feature is supported by version 18.2 or greater.

GroupDocs.Metadata API allows you to read additional metadata properties linked with ID3v2 tag. Following are the new properties you can read from ID3v2 metadata:

  • Subtitle (TIT3 frame)
  • MusicalKey (TKEY frame)
  • LengthInMilliseconds (TLEN frame)
  • OriginalAlbum (TOAL frame)
  • SizeInBytes (TSIZ frame)
  • ISRC (TSRC frame)
  • SoftwareHardware (TSSE frame)
  • PlayCounter (PCNT frame)

Following are the steps to read additional properties from the ID3v2 tag in MP3 format.

  1. Initialize Mp3Format
  2. Get ID3v2 tag using Mp3Format.Id3v2 property
  3. If ID3v2 tag is not Null and present then check for all of its properties

Reading Image Cover from ID3v2 

This feature is supported by version 18.2 or greater.

GroupDocs.Metadata API allows you to read image cover data from the ID3v2 tag in MP3 Format. 

Following are the steps to read image cover from the ID3v2 tag in MP3 format.

  1. Initialize Mp3Format
  2. Get ID3v2 tag using Mp3Format.GetId3v2Tag() property
  3. If ID3v2 tag is not Null, read APIC frames
  4. If frames are not Null, get AttachedPictureFrame 

Updating or Removing Image Cover from ID3v2 

This feature is supported by version 18.2 or greater.

GroupDocs.Metadata API allows you to update or remove image cover data from the ID3v2 tag in MP3 Format. 

Following are the steps to update or remove image cover from the ID3v2 tag in MP3 format.

  1. Initialize Mp3Format
  2. Get ID3v2 tag using Mp3Format.GetId3v2Tag() property
  3. Remove image cover using Mp3Metadata.RemoveImageCover()
  4. Update image cover using Mp3Metadata.UpdateID3v2(metadata)

Download Sample File

You can download sample Mp3 file used in this article.

Following is the path of sample Mp3 file used in code sample:

Labels
  • No labels