com.beaglebuddy.lyrics3

## Class Lyrics3v1Tag

- java.lang.Object
- - com.beaglebuddy.lyrics3.Lyrics3v1Tag

-     public class Lyrics3v1Tag
      extends java.lang.Object

  This class provides methods for reading the optional Lyrics3v1 tag , which is found at the end of an .mp3 file after the mpeg audio data and before the ID3v1.x tag as shown below. It is an obsolete tag that really should just be removed from your .mp3 files. See the CleanMP3Files.java file provided in the sample code to see how this is done.

       import java.io.IOException;
       import com.beaglebuddy.mp3.MP3;
       import com.beaglebuddy.lyrics3.v1.Lyrics3v1Tag;

       public class Lyrics3v1Example
       {
          public static void main(String[] args)
          {
             try
             {
                MP3 mp3 = new MP3("c:/mp3/Wild Cat.mp3");

                if (mp3.hasLyrics3v1Tag())                   // if the mp3 file has a Lyrics3v1 tag
                {                                            // then display the lyrics in it
                   Lyrics3v1Tag lyrics3v1Tag = mp3.getLyrics3v1Tag();
                   System.out.println("mp3 contains a Lyrics3v1 tag");

                   System.out.println(lyrics3v1Tag.getLyrics());
                }
             }
             catch (IOException ex)
             {
                System.out.println("An error occurred while reading the mp3 file.");
             }
          }
       }

  See Also:
    `Lyrics3v2Tag`, Lyrics3v1 Spec, Lyrics3v2 Spec

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Lyrics3v1Tag(java.io.RandomAccessFile file)` constructor used to read in a Lyrics3v1 tag from an .mp3 file.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getFilePosition()` get the position (in bytes) within the .mp3 file where the Lyrics3v1 tag starts.
    `java.lang.String` | `getLyrics()` gets the lyrics to the song.
    `int` | `getSize()` get the size (in bytes) of the entire Lyrics3v1 tag, including the end id.
    `java.lang.String` | `toString()` gets a string representation of the Lyrics3v1 tag.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Lyrics3v1Tag

          public Lyrics3v1Tag(java.io.RandomAccessFile file)
                       throws java.io.IOException,
                              ParseException

      constructor used to read in a Lyrics3v1 tag from an .mp3 file.
      Parameters:
        `file` - random access file to read in the Lyrics3v1 tag from an .mp3 file.
      Throws:
        `java.io.IOException` - if there is an error while reading the Lyrics3v1 tag.
        `ParseException` - if a Lyrics3v1 tag can not be found or if an invalid value is detected while parsing the Lyrics3v1 tag.

  - ### Method Detail

    - #### getSize

          public int getSize()

      get the size (in bytes) of the entire Lyrics3v1 tag, including the end id.
      Returns:
        the size (in bytes) of the entire Lyrics3v1 tag, including the end id.

    - #### getFilePosition

          public int getFilePosition()

      get the position (in bytes) within the .mp3 file where the Lyrics3v1 tag starts.
      Returns:
        the position (in bytes) within the .mp3 file where the Lyrics3v1 tag starts.

    - #### getLyrics

          public java.lang.String getLyrics()

      gets the lyrics to the song.
      Returns:
        the lyrics to the song.

    - #### toString

          public java.lang.String toString()

      gets a string representation of the Lyrics3v1 tag.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the Lyrics3v1 tag.