ID3V1Tag
Leave feedback
On this page
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()); // … } }
| Constructor | Description |
|---|---|
| ID3V1Tag() | Initializes a new instance of the ID3V1Tag class. |
| 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. |
public ID3V1Tag()
Initializes a new instance of the ID3V1Tag class.
public String getVersion()
Gets the ID3 version. It can be ID3 or ID3v1.1
Returns: java.lang.String - The ID3 version.
public final String getArtist()
Gets the artist. Maximum length is 30 characters.
Returns: java.lang.String - The artist.
public final void setArtist(String value)
Sets the artist. Maximum length is 30 characters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The artist. |
public final String getAlbum()
Gets the album. Maximum length is 30 characters.
Returns: java.lang.String - The album.
public final void setAlbum(String value)
Sets the album. Maximum length is 30 characters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The album. |
public final ID3V1Genre getGenreValue()
Gets the genre identifier.
Returns: ID3V1Genre - The genre identifier.
public final String getComment()
Gets the comment. Maximum length is 30 characters.
Returns: java.lang.String - The comment.
public final void setComment(String value)
Sets the comment. Maximum length is 30 characters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The comment. |
public final String getTitle()
Gets the title.
Returns: java.lang.String - The title.
public final void setTitle(String value)
Sets the title.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The title. |
public final String getYear()
Gets the year. Maximum length is 4 characters.
Returns: java.lang.String - The year.
public final void setYear(String value)
Sets the year. Maximum length is 4 characters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The year. |
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.
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. |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.