com.groupdocs.metadata.core

Interfaces

Classes

Enums

Exceptions

com.groupdocs.metadata.core

Class ID3V1Tag

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


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


    ID3(v1) tag is a small chunk of extra data at the end of MP3. Please find more information at <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 Detail

      • ID3V1Tag

        public ID3V1Tag()

        Initializes a new instance of the ID3V1Tag class.

    • Method Detail

      • getVersion

        public String getVersion()

        Gets the ID3 version. It can be ID3 or ID3v1.1

        Specified by:
        getVersion in class ID3Tag
        Returns:
        The ID3 version.
      • getArtist

        public final String getArtist()

        Gets the artist. Maximum length is 30 characters.

        Returns:
        The artist.
      • setArtist

        public final void setArtist(String value)

        Sets the artist. Maximum length is 30 characters.

        Parameters:
        value - The artist.
      • getAlbum

        public final String getAlbum()

        Gets the album. Maximum length is 30 characters.

        Returns:
        The album.
      • setAlbum

        public final void setAlbum(String value)

        Sets the album. Maximum length is 30 characters.

        Parameters:
        value - The album.
      • getGenreValue

        public final ID3V1Genre getGenreValue()

        Gets the genre identifier.

        Returns:
        The genre identifier.
      • getComment

        public final String getComment()

        Gets the comment. Maximum length is 30 characters.

        Returns:
        The comment.
      • setComment

        public final void setComment(String value)

        Sets the comment. Maximum length is 30 characters.

        Parameters:
        value - The comment.
      • getTitle

        public final String getTitle()

        Gets the title.

        Returns:
        The title.
      • setTitle

        public final void setTitle(String value)

        Sets the title.

        Parameters:
        value - The title.
      • getYear

        public final String getYear()

        Gets the year. Maximum length is 4 characters.

        Returns:
        The year.
      • setYear

        public final void setYear(String value)

        Sets the year. Maximum length is 4 characters.

        Parameters:
        value - The year.
      • getTrackNumber

        public final Integer getTrackNumber()

        Gets the track number. Presented in a ID3v1.1 tag only.

        Returns:
        The track number.


        If the value of TrackNumber is a positive integer then ID3 changes version to 'ID3v1.1' automatically.
      • setTrackNumber

        public final void setTrackNumber(Integer value)

        Sets the track number. Presented in a ID3v1.1 tag only.

        Parameters:
        value - The track number.


        If the value of TrackNumber is a positive integer then ID3 changes version to 'ID3v1.1' automatically.