com.groupdocs.metadata.core

Interfaces

Classes

Enums

Exceptions

com.groupdocs.metadata.core

Class LyricsTag

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    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>.


    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.

    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 Detail

      • LyricsTag

        public LyricsTag()

        Initializes a new instance of the LyricsTag class.

    • Method Detail

      • getLyrics

        public final String getLyrics()

        Gets the lyrics. This value is represented by the LYR field.

        Returns:
        The lyrics.
      • setLyrics

        public final void setLyrics(String value)

        Sets the lyrics. This value is represented by the LYR field.

        Parameters:
        value - The lyrics.
      • getAdditionalInfo

        public final String getAdditionalInfo()

        Gets the additional information. This value is represented by the INF field.

        Returns:
        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

        public final void setAdditionalInfo(String value)

        Sets the additional information. This value is represented by the INF field.

        Parameters:
        value - 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:
        The author.
      • setAuthor

        public final void setAuthor(String value)

        Sets the author. This value is represented by the AUT field.

        Parameters:
        value - The author.
      • getAlbum

        public final String getAlbum()

        Gets the album name. This value is represented by the EAL field.

        Returns:
        The album.
      • setAlbum

        public final void setAlbum(String value)

        Sets the album name. This value is represented by the EAL field.

        Parameters:
        value - The album.
      • getArtist

        public final String getArtist()

        Gets the artist name. This value is represented by the EAR field.

        Returns:
        The artist.
      • setArtist

        public final void setArtist(String value)

        Sets the artist name. This value is represented by the EAR field.

        Parameters:
        value - The artist.
      • getTrack

        public final String getTrack()

        Gets the track title. This value is represented by the ETT field.

        Returns:
        The track.
      • setTrack

        public final void setTrack(String value)

        Sets the track title. This value is represented by the ETT field.

        Parameters:
        value - The track.
      • set

        public final void set(LyricsField field)

        Adds or replaces the specified Lyrics3 field.

        Parameters:
        field - The field to be set.
      • remove

        public final void remove(String id)

        Removes the field with the specified id.

        Parameters:
        id - The field identifier.
      • get

        public final String get(String id)

        Gets the value of the field with the specified id.

        Parameters:
        id - The id of the field.
        Returns:
        The value if the tag contains a field with the specified id; otherwise, null.
      • toList

        public final IReadOnlyList<LyricsField> toList()

        Creates a list from the package.

        Returns:
        A list of all fields contained in the Lyrics3 tag.