public final class LyricsTag extends CustomPackage
Represents Lyrics3 v2.00 metadata.
Please find more information at <a hreh="http://id3.org/Lyrics3v2">http://id3.org/Lyrics3v2</a>
.
Learn more
This code sample shows how to read the Lyrics tag from an MP3 file.
try (Metadata metadata = new Metadata(Constants.MP3WithLyrics)) { MP3RootPackage root = metadata.getRootPackageGeneric(); if (root.getLyrics3V2() != null) { System.out.println(root.getLyrics3V2().getLyrics()); System.out.println(root.getLyrics3V2().getAlbum()); System.out.println(root.getLyrics3V2().getArtist()); System.out.println(root.getLyrics3V2().getTrack()); // ... // Alternatively, you can loop through a full list of tag fields for (LyricsField field : root.getLyrics3V2().toList()) { System.out.println(String.format("%s = %s", field.getID(), field.getData())); } } }
Constructor and Description |
---|
LyricsTag()
Initializes a new instance of the
LyricsTag class. |
Modifier and Type | Method and Description |
---|---|
String |
get(String id)
Gets the value of the field with the specified id.
|
String |
getAdditionalInfo()
Gets the additional information.
|
String |
getAlbum()
Gets the album name.
|
String |
getArtist()
Gets the artist name.
|
String |
getAuthor()
Gets the author.
|
String |
getLyrics()
Gets the lyrics.
|
String |
getTrack()
Gets the track title.
|
void |
remove(String id)
Removes the field with the specified id.
|
void |
set(LyricsField field)
Adds or replaces the specified Lyrics3 field.
|
void |
setAdditionalInfo(String value)
Sets the additional information.
|
void |
setAlbum(String value)
Sets the album name.
|
void |
setArtist(String value)
Sets the artist name.
|
void |
setAuthor(String value)
Sets the author.
|
void |
setLyrics(String value)
Sets the lyrics.
|
void |
setTrack(String value)
Sets the track title.
|
IReadOnlyList<LyricsField> |
toList()
Creates a list from the package.
|
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 final String getLyrics()
Gets the lyrics. This value is represented by the LYR field.
public final void setLyrics(String value)
Sets the lyrics. This value is represented by the LYR field.
value
- The lyrics.public final String getAdditionalInfo()
Gets the additional information. This value is represented by the INF field.
public final void setAdditionalInfo(String value)
Sets the additional information. This value is represented by the INF field.
value
- The additional information.
public final String getAuthor()
Gets the author. This value is represented by the AUT field.
public final void setAuthor(String value)
Sets the author. This value is represented by the AUT field.
value
- The author.public final String getAlbum()
Gets the album name. This value is represented by the EAL field.
public final void setAlbum(String value)
Sets the album name. This value is represented by the EAL field.
value
- The album.public final String getArtist()
Gets the artist name. This value is represented by the EAR field.
public final void setArtist(String value)
Sets the artist name. This value is represented by the EAR field.
value
- The artist.public final String getTrack()
Gets the track title. This value is represented by the ETT field.
public final void setTrack(String value)
Sets the track title. This value is represented by the ETT field.
value
- The track.public final void set(LyricsField field)
Adds or replaces the specified Lyrics3 field.
field
- The field to be set.public final void remove(String id)
Removes the field with the specified id.
id
- The field identifier.public final String get(String id)
Gets the value of the field with the specified id.
id
- The id of the field.public final IReadOnlyList<LyricsField> toList()
Creates a list from the package.