MediaTagInfo Class

Represents the metadata tags of a media file.

public sealed class MediaTagInfo

Constructors

NameDescription
MediaTagInfo()

MediaTagInfo()

MediaTagInfo.cs
public MediaTagInfo()

No documentation is available.

Properties

NameDescription
AlbumGets or sets the album name.
AlbumArtistGets or sets the album artist.
ArtistGets or sets the performing artist.
BpmGets or sets the beats per minute. Must not be negative.
CommentGets or sets a comment or description.
ComposerGets or sets the composer.
ConductorGets or sets the conductor.
CopyrightGets or sets the copyright information.
CustomFieldsGets the collection of custom or format-specific metadata fields.
DescriptionGets or sets a short description of the content. Only MP4 files store it.
DiscNumberGets or sets the disc number. Must not be negative.
DiscTotalGets or sets the total number of discs. Must not be negative.
DurationGets or sets the media duration.
FormatGets or sets the source format that the tags were read from.
GenreGets or sets the genre.
IsCompilationGets or sets whether this track is part of a compilation.
IsrcGets or sets the ISRC (International Standard Recording Code).
LongDescriptionGets or sets a long description of the content. Only MP4 files store it.
LyricsGets or sets the track lyrics.
MediaKindGets or sets the kind of media, such as a movie or a TV show. Only MP4 files store it.
MusicBrainzAlbumIdGets or sets the MusicBrainz album ID.
MusicBrainzArtistIdGets or sets the MusicBrainz artist ID.
MusicBrainzReleaseGroupIdGets or sets the MusicBrainz release group ID.
MusicBrainzTrackIdGets or sets the MusicBrainz recording ID.
NativeFieldsGets or sets the frames, items and attributes of the tag that no other property represents, as stored in the file.
PicturesGets the list of embedded pictures (album art).
ReplayGainGets or sets ReplayGain loudness normalization values.
TitleGets or sets the title of the track.
TrackNumberGets or sets the track number. Must not be negative.
TrackTotalGets or sets the total number of tracks. Must not be negative.
TvEpisodeGets or sets the TV episode number. Must not be negative. Only MP4 files store it.
TvEpisodeIdGets or sets the identifier of the TV episode, such as S01E02. Only MP4 files store it.
TvNetworkGets or sets the TV network that broadcast the episode. Only MP4 files store it.
TvSeasonGets or sets the TV season number. Must not be negative. Only MP4 files store it.
TvShowGets or sets the name of the TV show. Only MP4 files store it.
VideoHeightGets or sets the height, in pixels, of the video stream. It is read from the stream and never written.
VideoWidthGets or sets the width, in pixels, of the video stream. It is read from the stream and never written.
YearGets or sets the year of release. Must be between 0 and 9999.

Gets or sets the album name.

public string? Album { get; set; }

Property value

string?

AlbumArtist

MediaTagInfo.cs

Gets or sets the album artist.

public string? AlbumArtist { get; set; }

Property value

string?

Gets or sets the performing artist.

public string? Artist { get; set; }

Property value

string?

Gets or sets the beats per minute. Must not be negative.

public int? Bpm { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

Gets or sets a comment or description.

public string? Comment { get; set; }

Property value

string?

Gets or sets the composer.

public string? Composer { get; set; }

Property value

string?

Gets or sets the conductor.

public string? Conductor { get; set; }

Property value

string?

CustomFields

MediaTagInfo.cs

Gets the collection of custom or format-specific metadata fields.

public IDictionary<string, string> CustomFields { get; }

Description

MediaTagInfo.cs

Gets or sets a short description of the content. Only MP4 files store it.

public string? Description { get; set; }

Property value

string?

DiscNumber

MediaTagInfo.cs

Gets or sets the disc number. Must not be negative.

public int? DiscNumber { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

Gets or sets the total number of discs. Must not be negative.

public int? DiscTotal { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

Gets or sets the media duration.

public TimeSpan? Duration { get; set; }

Property value

TimeSpan?

Gets or sets the source format that the tags were read from.

public MediaFormat? Format { get; set; }

Property value

MediaFormat?

Gets or sets the genre.

public string? Genre { get; set; }

Property value

string?

IsCompilation

MediaTagInfo.cs

Gets or sets whether this track is part of a compilation.

public bool? IsCompilation { get; set; }

Property value

bool?

Gets or sets the ISRC (International Standard Recording Code).

public string? Isrc { get; set; }

Property value

string?

LongDescription

MediaTagInfo.cs

Gets or sets a long description of the content. Only MP4 files store it.

public string? LongDescription { get; set; }

Property value

string?

Gets or sets the track lyrics.

public string? Lyrics { get; set; }

Property value

string?

Gets or sets the kind of media, such as a movie or a TV show. Only MP4 files store it.

public MediaKind? MediaKind { get; set; }

Property value

MediaKind?

MusicBrainzAlbumId

MediaTagInfo.cs

Gets or sets the MusicBrainz album ID.

public string? MusicBrainzAlbumId { get; set; }

Property value

string?

MusicBrainzArtistId

MediaTagInfo.cs

Gets or sets the MusicBrainz artist ID.

public string? MusicBrainzArtistId { get; set; }

Property value

string?

MusicBrainzReleaseGroupId

MediaTagInfo.cs

Gets or sets the MusicBrainz release group ID.

public string? MusicBrainzReleaseGroupId { get; set; }

Property value

string?

MusicBrainzTrackId

MediaTagInfo.cs

Gets or sets the MusicBrainz recording ID.

public string? MusicBrainzTrackId { get; set; }

Property value

string?

NativeFields

MediaTagInfo.cs

Gets or sets the frames, items and attributes of the tag that no other property represents, as stored in the file.

public IList<MediaNativeField>? NativeFields { get; set; }

Property value

IList<MediaNativeField>?

Remarks

Reading sets a list, empty when the format has none. Writing a list replaces the fields of the tag type the format writes, and ignores the fields of other tag types. Writing null keeps the fields of the existing file, which is how a new MediaTagInfo changes the common fields without removing the format-specific ones.

A field that a property represents, such as the ID3v2 TIT2 frame, cannot be written as a native field: the write fails with MediaTagError.InvalidTagData. User-defined text fields (ID3v2 TXXX frames, MP4 freeform items, APEv2 text items and ASF text attributes) are in MediaTagInfo.CustomFields.

Gets the list of embedded pictures (album art).

public IList<MediaPicture> Pictures { get; }

Property value

IList<MediaPicture>

ReplayGain

MediaTagInfo.cs

Gets or sets ReplayGain loudness normalization values.

public ReplayGainInfo? ReplayGain { get; set; }

Property value

ReplayGainInfo?

Gets or sets the title of the track.

public string? Title { get; set; }

Property value

string?

TrackNumber

MediaTagInfo.cs

Gets or sets the track number. Must not be negative.

public int? TrackNumber { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

TrackTotal

MediaTagInfo.cs

Gets or sets the total number of tracks. Must not be negative.

public int? TrackTotal { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

Gets or sets the TV episode number. Must not be negative. Only MP4 files store it.

public int? TvEpisode { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

TvEpisodeId

MediaTagInfo.cs

Gets or sets the identifier of the TV episode, such as S01E02. Only MP4 files store it.

public string? TvEpisodeId { get; set; }

Property value

string?

Gets or sets the TV network that broadcast the episode. Only MP4 files store it.

public string? TvNetwork { get; set; }

Property value

string?

Gets or sets the TV season number. Must not be negative. Only MP4 files store it.

public int? TvSeason { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative.

Gets or sets the name of the TV show. Only MP4 files store it.

public string? TvShow { get; set; }

Property value

string?

VideoHeight

MediaTagInfo.cs

Gets or sets the height, in pixels, of the video stream. It is read from the stream and never written.

public int? VideoHeight { get; set; }

Property value

int?

VideoWidth

MediaTagInfo.cs

Gets or sets the width, in pixels, of the video stream. It is read from the stream and never written.

public int? VideoWidth { get; set; }

Property value

int?

Gets or sets the year of release. Must be between 0 and 9999.

public int? Year { get; set; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is negative or greater than 9999.