ID3V1Tag

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.CustomPackage, com.groupdocs.metadata.core.ID3Tag

public final class ID3V1Tag extends ID3Tag

Represents an ID3v1 tag. Please find more information at https://en.wikipedia.org/wiki/ID3#ID3v1 .


ID3(v1) tag is a small chunk of extra data at the end of MP3. Please find more information at http://id3.org/ID3v1 .

Learn more

This code sample shows how to read the ID3v1 tag in an MP3 file.

try (Metadata metadata = new Metadata(Constants.MP3WithID3V1)) { MP3RootPackage root = metadata.getRootPackageGeneric(); if (root.getID3V1() != null) { System.out.println(root.getID3V1().getAlbum()); System.out.println(root.getID3V1().getArtist()); System.out.println(root.getID3V1().getTitle()); System.out.println(root.getID3V1().getVersion()); System.out.println(root.getID3V1().getComment()); // … } }

Constructors

Constructor Description
ID3V1Tag() Initializes a new instance of the ID3V1Tag class.

Methods

Method Description
getVersion() Gets the ID3 version.
getArtist() Gets the artist.
setArtist(String value) Sets the artist.
getAlbum() Gets the album.
setAlbum(String value) Sets the album.
getGenreValue() Gets the genre identifier.
getComment() Gets the comment.
setComment(String value) Sets the comment.
getTitle() Gets the title.
setTitle(String value) Sets the title.
getYear() Gets the year.
setYear(String value) Sets the year.
getTrackNumber() Gets the track number.
setTrackNumber(Integer value) Sets the track number.

ID3V1Tag()

public ID3V1Tag()

Initializes a new instance of the ID3V1Tag class.

getVersion()

public String getVersion()

Gets the ID3 version. It can be ID3 or ID3v1.1

Returns: java.lang.String - The ID3 version.

getArtist()

public final String getArtist()

Gets the artist. Maximum length is 30 characters.

Returns: java.lang.String - The artist.

setArtist(String value)

public final void setArtist(String value)

Sets the artist. Maximum length is 30 characters.

Parameters:

Parameter Type Description
value java.lang.String The artist.

getAlbum()

public final String getAlbum()

Gets the album. Maximum length is 30 characters.

Returns: java.lang.String - The album.

setAlbum(String value)

public final void setAlbum(String value)

Sets the album. Maximum length is 30 characters.

Parameters:

Parameter Type Description
value java.lang.String The album.

getGenreValue()

public final ID3V1Genre getGenreValue()

Gets the genre identifier.

Returns: ID3V1Genre - The genre identifier.

getComment()

public final String getComment()

Gets the comment. Maximum length is 30 characters.

Returns: java.lang.String - The comment.

setComment(String value)

public final void setComment(String value)

Sets the comment. Maximum length is 30 characters.

Parameters:

Parameter Type Description
value java.lang.String The comment.

getTitle()

public final String getTitle()

Gets the title.

Returns: java.lang.String - The title.

setTitle(String value)

public final void setTitle(String value)

Sets the title.

Parameters:

Parameter Type Description
value java.lang.String The title.

getYear()

public final String getYear()

Gets the year. Maximum length is 4 characters.

Returns: java.lang.String - The year.

setYear(String value)

public final void setYear(String value)

Sets the year. Maximum length is 4 characters.

Parameters:

Parameter Type Description
value java.lang.String The year.

getTrackNumber()

public final Integer getTrackNumber()

Gets the track number. Presented in a ID3v1.1 tag only.

Returns: java.lang.Integer - The track number.


If the value of TrackNumber is a positive integer then ID3 changes version to ‘ID3v1.1’ automatically.

setTrackNumber(Integer value)

public final void setTrackNumber(Integer value)

Sets the track number. Presented in a ID3v1.1 tag only.

Parameters:

Parameter Type Description
value java.lang.Integer The track number.

If the value of TrackNumber is a positive integer then ID3 changes version to ‘ID3v1.1’ automatically. |