Introduction

edit

Meziantou.Framework.MediaTags reads and writes the metadata of audio and video files: title, artist, album, track numbers, artwork, lyrics, ReplayGain values, TV show details and more. One type, MediaTagInfo, holds the tags of every format, so the same code works for an MP3 file and a FLAC file. The fields of a format that no property represents are still readable and writable, as native fields.

Supported formats

FormatMediaFormatTags
MP3Mp3ID3v2, and ID3v1
OGG VorbisOggVorbisVorbis comments
OGG OpusOggOpusVorbis comments
FLACFlacVorbis comments and picture blocks
MP4 / M4A / M4V / MOVMp4iTunes-style metadata, audio or video
WAVWavAn embedded ID3v2 tag, or LIST/INFO chunks
AIFFAiffAn embedded ID3v2 tag
Monkey's Audio (APE)MonkeysAudioAPEv2
WavPackWavPackAPEv2
MusepackMusepackAPEv2
ASF (WMA / WMV)AsfASF attributes, audio or video

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, MediaNativeField, MediaTagWriteOptions and the result types.

Next steps