Lyrics3 v2.00 uses fields to represent information. The data in a field can consist of ASCII characters in the range 01 to 254 according to the standard. As the ASCII character map is only defined from 00 to 128 ISO-8859-1 might be assumed. Numerical fields are 5 or 6 characters long, depending on location, and are padded with zeroes.
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()));
}
}
}
Initializes a new instance of the LyricsTag class.
getLyrics()
public final String getLyrics()
Gets the lyrics. This value is represented by the LYR field.
Returns:
java.lang.String - The lyrics.
setLyrics(String value)
public final void setLyrics(String value)
Sets the lyrics. This value is represented by the LYR field.
Parameters:
Parameter
Type
Description
value
java.lang.String
The lyrics.
getAdditionalInfo()
public final String getAdditionalInfo()
Gets the additional information. This value is represented by the INF field.
Returns:
java.lang.String - The additional information.
This is always three (3) characters long in v2.00, but might be longer in a future standard. The first byte indicates weather or not a lyrics field is present. “1” for present and “0” for otherwise. The second character indicates if there is a timestamp in the lyrics. Again “1” for yes and “0” for no. The third character inhibits tracks for random selection - “1” if inhibited and “0” if not.
setAdditionalInfo(String value)
public final void setAdditionalInfo(String value)
Sets the additional information. This value is represented by the INF field.
Parameters:
Parameter
Type
Description
value
java.lang.String
The additional information.
This is always three (3) characters long in v2.00, but might be longer in a future standard. The first byte indicates weather or not a lyrics field is present. “1” for present and “0” for otherwise. The second character indicates if there is a timestamp in the lyrics. Again “1” for yes and “0” for no. The third character inhibits tracks for random selection - “1” if inhibited and “0” if not. |
getAuthor()
public final String getAuthor()
Gets the author. This value is represented by the AUT field.
Returns:
java.lang.String - The author.
setAuthor(String value)
public final void setAuthor(String value)
Sets the author. This value is represented by the AUT field.
Parameters:
Parameter
Type
Description
value
java.lang.String
The author.
getAlbum()
public final String getAlbum()
Gets the album name. This value is represented by the EAL field.
Returns:
java.lang.String - The album.
setAlbum(String value)
public final void setAlbum(String value)
Sets the album name. This value is represented by the EAL field.
Parameters:
Parameter
Type
Description
value
java.lang.String
The album.
getArtist()
public final String getArtist()
Gets the artist name. This value is represented by the EAR field.
Returns:
java.lang.String - The artist.
setArtist(String value)
public final void setArtist(String value)
Sets the artist name. This value is represented by the EAR field.
Parameters:
Parameter
Type
Description
value
java.lang.String
The artist.
getTrack()
public final String getTrack()
Gets the track title. This value is represented by the ETT field.
Returns:
java.lang.String - The track.
setTrack(String value)
public final void setTrack(String value)
Sets the track title. This value is represented by the ETT field.