public final class ID3V1Tag extends ID3Tag
Represents an ID3v1 tag.
Please find more information at <a href="https://en.wikipedia.org/wiki/ID3#ID3v1">https://en.wikipedia.org/wiki/ID3#ID3v1</a>
.
<a href="http://id3.org/ID3v1">http://id3.org/ID3v1</a>
.
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()); // ... } }
Constructor and Description |
---|
ID3V1Tag()
Initializes a new instance of the
ID3V1Tag class. |
Modifier and Type | Method and Description |
---|---|
String |
getAlbum()
Gets the album.
|
String |
getArtist()
Gets the artist.
|
String |
getComment()
Gets the comment.
|
ID3V1Genre |
getGenreValue()
Gets the genre identifier.
|
String |
getTitle()
Gets the title.
|
Integer |
getTrackNumber()
Gets the track number.
|
String |
getVersion()
Gets the ID3 version.
|
String |
getYear()
Gets the year.
|
void |
setAlbum(String value)
Sets the album.
|
void |
setArtist(String value)
Sets the artist.
|
void |
setComment(String value)
Sets the comment.
|
void |
setTitle(String value)
Sets the title.
|
void |
setTrackNumber(Integer value)
Sets the track number.
|
void |
setYear(String value)
Sets the year.
|
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, sanitize, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public String getVersion()
Gets the ID3 version. It can be ID3 or ID3v1.1
getVersion
in class ID3Tag
public final String getArtist()
Gets the artist. Maximum length is 30 characters.
public final void setArtist(String value)
Sets the artist. Maximum length is 30 characters.
value
- The artist.public final String getAlbum()
Gets the album. Maximum length is 30 characters.
public final void setAlbum(String value)
Sets the album. Maximum length is 30 characters.
value
- The album.public final ID3V1Genre getGenreValue()
Gets the genre identifier.
public final String getComment()
Gets the comment. Maximum length is 30 characters.
public final void setComment(String value)
Sets the comment. Maximum length is 30 characters.
value
- The comment.public final String getTitle()
Gets the title.
public final void setTitle(String value)
Sets the title.
value
- The title.public final String getYear()
Gets the year. Maximum length is 4 characters.
public final void setYear(String value)
Sets the year. Maximum length is 4 characters.
value
- The year.public final Integer getTrackNumber()
Gets the track number. Presented in a ID3v1.1 tag only.
TrackNumber
is a positive integer then ID3 changes version to 'ID3v1.1' automatically.
public final void setTrackNumber(Integer value)
Sets the track number. Presented in a ID3v1.1 tag only.
value
- The track number.
TrackNumber
is a positive integer then ID3 changes version to 'ID3v1.1' automatically.