Introduction

edit

Meziantou.Framework.MediaTags reads and writes the metadata of audio files: title, artist, album, track numbers, artwork, lyrics, ReplayGain values and more. One type, MediaTagInfo, holds the tags of every format, so the same code works for an MP3 file and a FLAC file.

Supported formats

FormatMediaFormatTags
MP3Mp3ID3v2, and ID3v1
OGG VorbisOggVorbisVorbis comments
OGG OpusOggOpusVorbis comments
FLACFlacVorbis comments and picture blocks
MP4 / M4AMp4iTunes-style metadata
WAVWavAn embedded ID3v2 tag, or LIST/INFO chunks
AIFFAiffAn embedded ID3v2 tag

The fields each format stores are listed in Format support.

What you can do with it

  • Read the tags of a file or a stream, with the duration and the embedded pictures. See Reading tags.
  • Change the tags of a file, safely: the file is only replaced once the new content is complete. See Writing tags.
  • Remove the tags of a file.
  • Detect the format of a file from its content.

Problems with a file, such as a corrupt or unsupported file, are returned as a result rather than thrown, so a program that walks a music library does not need a try block for each file.

Namespace

Every type is in the Meziantou.Framework.MediaTags namespace: MediaFile, MediaTagInfo, MediaPicture, ReplayGainInfo, MediaTagWriteOptions and the result types.

Next steps