com.beaglebuddy.mp3

## Class MP3Base

- java.lang.Object
- - com.beaglebuddy.mp3.MP3BaseID3v23
  - - com.beaglebuddy.mp3.MP3BaseID3v24
    - - com.beaglebuddy.mp3.MP3Base

- Direct Known Subclasses:
    MP3

      public class MP3Base
      extends MP3BaseID3v24

  This base class provides some underlying methods that help make the derived MP3 class's interface much cleaner and easier to understand. Thus, this class provides lower level methods that are used by the MP3 class, but would otherwise clutter the MP3 class's public interface.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected APETag` | `apeTag` the optional APEv1 tag is found at the end of the .mp3 file, while the APEv2 tag can be found at the beginning or end of the .mp3 file.
    `protected int` | `audioSize` size (in bytes) of the audio portion of the .mp3 file.
    `protected int` | `bitrate` the actual bit rate for `CBR` encoded .mp3 files and the average bit rate for `VBR` encoded .mp3 files.
    `protected BitrateType` | `bitrateType` whether the mp3 file was encoded with a constant bit rate (`CBR`) or with a variable bit rate (`VBR`).
    `protected int` | `fileSize` size (in bytes) of the .mp3 file.
    `protected ID3v1Tag` | `id3v1Tag` the optional ID3v1 tag which can found at the end of the .mp3 file, after the mp3 audio data.
    `protected Lyrics3v1Tag` | `lyrics3v1Tag` the optional Lyrics3v1 tag which can found at the end of the .mp3 file, after the mp3 audio data and before the ID3v1 tag.
    `protected Lyrics3v2Tag` | `lyrics3v2Tag` the optional Lyrics3v2 tag which can found at the end of the .mp3 file, after the mp3 audio data and before the ID3v1 tag.
    `protected java.io.File` | `mp3File` if the mp3 file is loaded from a local file, then this data member will contain the path to the .mp3 file.
    `protected java.net.URL` | `mp3Url` if the mp3 file is loaded from a URL, then this data member will contain the URL to the .mp3 file.
    `protected MPEGFrame` | `mpegFrame` the 1st mpeg audio frame found after the end of the ID3v2.x tag.
    `protected int` | `tagSize` size (in bytes) of the ID3v2.x tag.

    - ### Fields inherited from class com.beaglebuddy.mp3.MP3BaseID3v24

      `id3v24Tag`

    - ### Fields inherited from class com.beaglebuddy.mp3.MP3BaseID3v23

      `id3v23Tag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MP3Base(java.io.File mp3File)` constructor.
    `MP3Base(java.lang.String mp3File)` constructor.
    `MP3Base(java.net.URL mp3Url)` constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `calculateAudioDuration()` calculates the duration of the song (in seconds) from data found in the `mpeg audio frames`.
    `void` | `displayErrors(java.io.PrintStream printStream)` displays any errors found in the ID3v2.x tag from the .mp3 file.
    `APETag` | `getAPETag()` gets the optional APE tag.
    `java.util.List<java.lang.String>` | `getErrors()` gets a list of any errors found in the ID3v2.x tag.
    `long` | `getFileSize()` returns the size (in bytes) of the .mp3 file.
    `MPEGFrame` | `getFirstMpegFrame()` gets the first `MPEGFrame` found after the ID3v2.x tag.
    `ID3v1Tag` | `getID3v1Tag()` gets the optional ID3v1 tag.
    `ID3v24Tag` | `getID3v24TagAtEnd()` gets the optional `ID3v2.4 tag` found at the end of an .mp3 file.
    `int` | `getID3v2xPadding()` gets the size of the padding inside the ID3v2.x tag.
    `Lyrics3v1Tag` | `getLyrics3v1Tag()` gets the optional Lyrics3v1 tag.
    `Lyrics3v2Tag` | `getLyrics3v2Tag()` gets the optional Lyrics3v2 tag.
    `java.lang.String` | `getPath()` gets the path to the .mp3 file.
    `protected java.lang.String` | `getReadOnlyErrorMessage()` gets the read only error message to display to users when they try to modify an .mp3 file loaded from a URL.
    `boolean` | `hasAPETag()` determines whether the .mp3 file has a `APE tag` at the beginning or end of the .mp3 file.
    `boolean` | `hasErrors()` determines if the mp3 file had any errors in the information stored in the frames of the ID3v2.x tag.
    `boolean` | `hasID3v1Tag()` determines whether the .mp3 file has an `ID3v1 tag` at the end of the .mp3 file.
    `boolean` | `hasID3v24TagAtEnd()` determines whether the .mp3 file has an `ID3v2.4 tag` at the end of the .mp3 file.
    `boolean` | `hasLyrics3v1Tag()` determines whether the .mp3 file has a `Lyrics3v1 tag` at the end of the .mp3 file.
    `boolean` | `hasLyrics3v2Tag()` determines whether the .mp3 file has a `Lyrics3v2 tag` at the end of the .mp3 file.
    `boolean` | `isConstantBitRate()` determines whether the mp3 file is encoded at a constant bit rate (`CBR`).
    `protected void` | `readMP3File(java.io.File mp3File)` reads in and parses the mp3 file.
    `void` | `removeAPETag()` remove the `APE tag` at the end of the .mp3 file.
    `void` | `removeID3v1Tag()` remove the `ID3v1 tag` at the end of the .mp3 file.
    `void` | `removeID3v24TagAtEnd()` remove the `ID3v2.4 tag` at the end of the .mp3 file.
    `void` | `removeLyrics3v1Tag()` remove the `Lyrics3v1 tag` at the end of the .mp3 file.
    `void` | `removeLyrics3v2Tag()` remove the `Lyrics3v2 tag` at the end of the .mp3 file.
    `protected void` | `saveID3v23()` save the `ID3v2.3 tag` to the .mp3 file.
    `protected void` | `saveID3v24()` save the `ID3v2.4 tag` to the .mp3 file.
    `void` | `setID3v2xPadding(int newPaddingSize)` this method sets the padding inside the ID3v2.x tag to the specified amount and saves the .mp3 file.
    `java.lang.String` | `toString()` gets a string representation of the mp3 file.
    `java.util.List<java.lang.String>` | `validateMPEGFrames()` This method reads through the audio portion of an .mp3 file and validates the `MPEG audio frames`.

    - ### Methods inherited from class com.beaglebuddy.mp3.MP3BaseID3v24

      `addV24Frame, getID3v24Tag, getV24Album, getV24AttachedPicture, getV24AttachedPictureFrame, getV24AttachedPictures, getV24AudioDuration, getV24Band, getV24Comments, getV24CommentsFrame, getV24Disc, getV24Errors, getV24Frame, getV24Frames, getV24LeadPerformer, getV24LyricsBy, getV24MusicBy, getV24MusicType, getV24Publisher, getV24Rating, getV24SynchronizedLyrics, getV24SynchronizedLyricsFrame, getV24Text, getV24TextAsInteger, getV24Title, getV24Track, getV24UnsynchronizedLyrics, getV24UnsynchronizedLyricsFrame, getV24Year, hasV24Errors, removeV24Album, removeV24AttachedPicture, removeV24AttachedPictures, removeV24AudioDuration, removeV24AudioSize, removeV24Band, removeV24Comments, removeV24Comments, removeV24Disc, removeV24Frame, removeV24Frames, removeV24LeadPerformer, removeV24LyricsBy, removeV24MusicBy, removeV24MusicType, removeV24Publisher, removeV24Rating, removeV24SynchronizedLyrics, removeV24Title, removeV24Track, removeV24UnsynchronizedLyrics, removeV24Year, setV24Album, setV24AttachedPicture, setV24AudioDuration, setV24Band, setV24Comments, setV24Disc, setV24LeadPerformer, setV24LyricsBy, setV24MusicBy, setV24MusicType, setV24MusicType, setV24Publisher, setV24Rating, setV24SynchronizedLyrics, setV24SynchronizedLyrics, setV24SynchronizedLyrics, setV24Text, setV24Text, setV24Text, setV24Title, setV24Track, setV24UnsynchronizedLyrics, setV24Year`

    - ### Methods inherited from class com.beaglebuddy.mp3.MP3BaseID3v23

      `addV23Frame, getID3v23Tag, getV23Album, getV23AttachedPicture, getV23AttachedPictureFrame, getV23AttachedPictures, getV23AudioDuration, getV23AudioSize, getV23Band, getV23Comments, getV23CommentsFrame, getV23Disc, getV23Errors, getV23Frame, getV23Frames, getV23LeadPerformer, getV23LyricsBy, getV23MusicBy, getV23MusicType, getV23Publisher, getV23Rating, getV23SynchronizedLyrics, getV23SynchronizedLyricsFrame, getV23Text, getV23TextAsInteger, getV23Title, getV23Track, getV23UnsynchronizedLyrics, getV23UnsynchronizedLyricsFrame, getV23Year, hasV23Errors, removeV23Album, removeV23AttachedPicture, removeV23AttachedPictures, removeV23AudioDuration, removeV23AudioSize, removeV23Band, removeV23Comments, removeV23Comments, removeV23Disc, removeV23Frame, removeV23Frames, removeV23LeadPerformer, removeV23LyricsBy, removeV23MusicBy, removeV23MusicType, removeV23Publisher, removeV23Rating, removeV23SynchronizedLyrics, removeV23Title, removeV23Track, removeV23UnsynchronizedLyrics, removeV23Year, setV23Album, setV23AttachedPicture, setV23AudioDuration, setV23AudioSize, setV23Band, setV23Comments, setV23Disc, setV23LeadPerformer, setV23LyricsBy, setV23MusicBy, setV23MusicType, setV23MusicType, setV23Publisher, setV23Rating, setV23SynchronizedLyrics, setV23SynchronizedLyrics, setV23SynchronizedLyrics, setV23Text, setV23Text, setV23Text, setV23Title, setV23Track, setV23UnsynchronizedLyrics, setV23Year`

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

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

- - ### Field Detail

    - #### mp3File

          protected java.io.File mp3File

      if the mp3 file is loaded from a local file, then this data member will contain the path to the .mp3 file. Otherwise, this data member will be null.

    - #### mp3Url

          protected java.net.URL mp3Url

      if the mp3 file is loaded from a URL, then this data member will contain the URL to the .mp3 file. Otherwise, this data member will be null.

    - #### fileSize

          protected int fileSize

      size (in bytes) of the .mp3 file.

    - #### tagSize

          protected int tagSize

      size (in bytes) of the ID3v2.x tag.

    - #### audioSize

          protected int audioSize

      size (in bytes) of the audio portion of the .mp3 file. That is, the number of bytes comprising the actual sound data for the song.

    - #### mpegFrame

          protected MPEGFrame mpegFrame

      the 1st mpeg audio frame found after the end of the ID3v2.x tag.

    - #### bitrate

          protected int bitrate

      the actual bit rate for `CBR` encoded .mp3 files and the average bit rate for `VBR` encoded .mp3 files.

    - #### bitrateType

          protected BitrateType bitrateType

      whether the mp3 file was encoded with a constant bit rate (`CBR`) or with a variable bit rate (`VBR`).

    - #### id3v1Tag

          protected ID3v1Tag id3v1Tag

      the optional ID3v1 tag which can found at the end of the .mp3 file, after the mp3 audio data.

    - #### lyrics3v1Tag

          protected Lyrics3v1Tag lyrics3v1Tag

      the optional Lyrics3v1 tag which can found at the end of the .mp3 file, after the mp3 audio data and before the ID3v1 tag.

    - #### lyrics3v2Tag

          protected Lyrics3v2Tag lyrics3v2Tag

      the optional Lyrics3v2 tag which can found at the end of the .mp3 file, after the mp3 audio data and before the ID3v1 tag.

    - #### apeTag

          protected APETag apeTag

      the optional APEv1 tag is found at the end of the .mp3 file, while the APEv2 tag can be found at the beginning or end of the .mp3 file.

  - ### Constructor Detail

    - #### MP3Base

          public MP3Base(java.lang.String mp3File)
                  throws java.io.IOException

      constructor.
      Parameters:
        `mp3File` - path to the .mp3 file from which to get information.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.

    - #### MP3Base

          public MP3Base(java.io.File mp3File)
                  throws java.io.IOException

      constructor.
      Parameters:
        `mp3File` - .mp3 file from which to get information.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.

    - #### MP3Base

          public MP3Base(java.net.URL mp3Url)
                  throws java.io.IOException

      constructor.
      Parameters:
        `mp3Url` - URL of an .mp3 file from which to get information.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.

  - ### Method Detail

    - #### readMP3File

          protected void readMP3File(java.io.File mp3File)
                              throws java.io.IOException

      reads in and parses the mp3 file.
      Parameters:
        `mp3File` - .mp3 file from which to get information.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.

    - #### validateMPEGFrames

          public java.util.List<java.lang.String> validateMPEGFrames()
                                                              throws java.io.IOException

      This method reads through the audio portion of an .mp3 file and validates the `MPEG audio frames`. It makes sure that the MPEG audio frames:
      - are the correct type: MPEG 1 Layer |||
      - are located where they are supposed to be
      - have valid `MPEG frame headers`
      - have a valid structure (`frame header` followed by `side information` followed by `audio data`)
      - use the same bit rate for every audio sample when the mp3 file is encoded with a `constant bit rate`
      It also makes sure that:
      - `Xing`, `Lame`, and `VBRI` headers occur only in the 1st `MPEG audio frame`
      - `VBR` encoded .mp3 files contain a VBR header
      note: This method should only be called on .mp3 files that are loaded from a file system. This is due to the amount of time it takes to download and read through an .mp3 file that is loaded from a URL. If invoked on an .mp3 loaded from a URL, this method will simply return an empty list, indicating no errors were found.
      Returns:
        a list of errors found in the MPEG audio section of the .mp3 file. If no errors were found, then an empty list is returned.
      Throws:
        `java.io.IOException` - if the .mp3 file can not be read.
      See Also:
        ID3v1 specification, APE v2 specification, LYRICS 3.2 specification

    - #### hasErrors

          public boolean hasErrors()

      determines if the mp3 file had any errors in the information stored in the frames of the ID3v2.x tag. If any of the ID3v2.x frames were invalid, then they are removed from the ID3v2.x tag.
      Returns:
        whether any invalid ID3v2.x frames were found in the ID3v2.x tag from the .mp3 file.
      See Also:
        `getErrors()`, `displayErrors(PrintStream)`

    - #### getErrors

          public java.util.List<java.lang.String> getErrors()

      gets a list of any errors found in the ID3v2.x tag.
      Returns:
        a list of errors found in the ID3v2.x tag. If no errors were found, then an empty list is returned.
      See Also:
        `hasErrors()`, `displayErrors(PrintStream)`

    - #### displayErrors

          public void displayErrors(java.io.PrintStream printStream)

      displays any errors found in the ID3v2.x tag from the .mp3 file. If no errors were found, then nothing is written to the print stream.
      Parameters:
        `printStream` - print stream used to write out the errors.
      See Also:
        `getErrors()`, `hasErrors()`

    - #### getReadOnlyErrorMessage

          protected java.lang.String getReadOnlyErrorMessage()

      gets the read only error message to display to users when they try to modify an .mp3 file loaded from a URL.
      Returns:
        the read only error message to display to users when they try to modify an .mp3 file loaded from a URL.

    - #### getPath

          public java.lang.String getPath()

      gets the path to the .mp3 file. This method may be called regardless of whether the .mp3 file was loaded from a file system or from a url.
      Example:`

               // load the song "Take Hold of the Flame" from Queensryche's album, "The Warning".
               MP3 mp3 = new MP3("c:/mp3/queensryche/the warning/take hold of the flame.mp3");
               System.out.println("the mp3 file was loaded from " + mp3.getPath());

               // load the song "Take Hold of the Flame" from Queensryche's album, "The Warning".
               MP3 mp3 = new MP3("http://www.beaglebuddy.com/mp3/queensryche/the warning/take hold of the flame.mp3");
               System.out.println("the mp3 file was loaded from " + mp3.getPath());

      `
      Returns:
        the path to the .mp3 file.

    - #### getFileSize

          public long getFileSize()

      returns the size (in bytes) of the .mp3 file.
      Returns:
        the size (in bytes) of the .mp3 file.

    - #### calculateAudioDuration

          protected int calculateAudioDuration()

      calculates the duration of the song (in seconds) from data found in the `mpeg audio frames`.
      Returns:
        the length (in seconds) of the song.

    - #### isConstantBitRate

          public boolean isConstantBitRate()

      determines whether the mp3 file is encoded at a constant bit rate (`CBR`).
      Returns:
        whether the mp3 file is encoded at a constant bit rate (`CBR`).

    - #### hasID3v1Tag

          public boolean hasID3v1Tag()

      determines whether the .mp3 file has an `ID3v1 tag` at the end of the .mp3 file. This method can only be called on mp3's loaded from a file.
      Returns:
        whether the .mp3 file has an `ID3v1 tag` at the end of the .mp3 file.

    - #### getID3v1Tag

          public ID3v1Tag getID3v1Tag()

      gets the optional ID3v1 tag.
      Returns:
        the optional ID3v1 tag, if present, and null otherwise.

    - #### hasID3v24TagAtEnd

          public boolean hasID3v24TagAtEnd()
                                    throws java.io.IOException,
                                           java.lang.IllegalStateException

      determines whether the .mp3 file has an `ID3v2.4 tag` at the end of the .mp3 file.
      Returns:
        whether the .mp3 file has an `ID3v2.4 tag` at the end of the .mp3 file.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and therefore will take a considerable amount of time to reach the `ID3v2.4 tag` at the end of the .mp3 file.

    - #### hasAPETag

          public boolean hasAPETag()

      determines whether the .mp3 file has a `APE tag` at the beginning or end of the .mp3 file. This method can only be called on mp3's loaded from a file.
      Returns:
        whether the .mp3 file has a `APE tag` at the beginning or end of the .mp3 file.

    - #### getAPETag

          public APETag getAPETag()

      gets the optional APE tag.
      Returns:
        the optional APE tag, if present, and null otherwise.

    - #### hasLyrics3v1Tag

          public boolean hasLyrics3v1Tag()

      determines whether the .mp3 file has a `Lyrics3v1 tag` at the end of the .mp3 file. This method can only be called on mp3's loaded from a file.
      Returns:
        whether the .mp3 file has a `Lyrics3v1 tag` at the end of the .mp3 file.

    - #### hasLyrics3v2Tag

          public boolean hasLyrics3v2Tag()

      determines whether the .mp3 file has a `Lyrics3v2 tag` at the end of the .mp3 file. This method can only be called on mp3's loaded from a file.
      Returns:
        whether the .mp3 file has a `Lyrics3v2 tag` at the end of the .mp3 file.

    - #### getLyrics3v1Tag

          public Lyrics3v1Tag getLyrics3v1Tag()

      gets the optional Lyrics3v1 tag.
      Returns:
        the optional Lyrics3v1 tag, if present, and null otherwise.

    - #### getLyrics3v2Tag

          public Lyrics3v2Tag getLyrics3v2Tag()

      gets the optional Lyrics3v2 tag.
      Returns:
        the optional Lyrics3v2 tag, if present, and null otherwise.

    - #### getFirstMpegFrame

          public MPEGFrame getFirstMpegFrame()

      gets the first `MPEGFrame` found after the ID3v2.x tag. MP3 files store the audio data in MPEG audio frames. They should occur one right after the other and form an unbroken stream of MPEG audio frames. Almost all of the mp3 programs and libraries available on the internet today find the first MPEG audio frame by searching the .mp3 file following the ID3v2.x tag which is located at the beginning of the .mp3 file. While this works most of the time, there is a problem with this method. It is possible that a "false synch" is encountered. That is, what appears to be a valid MPEG audio frame is really just some other data that just happens to look like an actual MPEG audio frame. For this reason, the Beaglebuddy mp3 library checks to make sure that the first MPEG audio frame found is directly followed by the second MPEG audio frame. If it isn't, then the Beaglebuddy mp3 library continues searching until it finds two valid MPEG audio frames in a row. When two valid MPEG audio frames are found in a row, then we are reasonably certain that the beginning of the MPEG audio stream has indeed been found and not a "false synch". Since the `bit rate type`, `codec`, `frequency`, `bit rate`, etc. are all obtained from the first MPEG audio frame, you might see discrepancies between the Beaglebuddy mp3 library and other programs. The reason is because the Beaglebuddy mp3 library is more stringent when locating the first MPEG audio frame than are the other .mp3 programs.
      Returns:
        the first mpeg audio frame found after the ID3v2.x tag.

    - #### getID3v24TagAtEnd

          public ID3v24Tag getID3v24TagAtEnd()
                                      throws java.io.IOException,
                                             java.lang.IllegalStateException

      gets the optional `ID3v2.4 tag` found at the end of an .mp3 file. This really is a stupid addition to the Id3v2.4 standard.
      Returns:
        the `ID3v2.4 tag` found at the end of an .mp3 file if present. Otherwise null is returned.
      Throws:
        `java.io.IOException` - if there is a problem reading the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and therefore will take a considerable amount of time to reach the `ID3v2.4 tag` at the end of the .mp3 file.

    - #### removeID3v1Tag

          public void removeID3v1Tag()
                              throws java.io.IOException

      remove the `ID3v1 tag` at the end of the .mp3 file. This method simply truncates the end of the .mp3 file to remove the ID3v1 tag, and hence does not require a call to the `MP3.save()` method. It does not save any changes to the ID3v2.x tag.
      Throws:
        `java.io.IOException` - if there was an error truncating the `ID3v1 tag` from the end of the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and is therefore considered to be read only and thus may not be modified.

    - #### removeLyrics3v1Tag

          public void removeLyrics3v1Tag()
                                  throws java.io.IOException

      remove the `Lyrics3v1 tag` at the end of the .mp3 file. This method simply truncates the end of the .mp3 file to remove the Lyrics3v1 tag, and hence does not require a call to the `MP3.save()` method. It does not save any changes to the ID3v2.x tag. Since the Lyrics3v1 tag is found after the mpeg audio and before the `ID3v1 tag` at the end of the .mp3 file, removing the Lyrics3v1 tag from the .mp3 file will also remove the ID3v1 tag as well.
      Throws:
        `java.io.IOException` - if there was an error truncating the `Lyrics3v1 tag` from the end of the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and is therefore considered to be read only and thus may not be modified, or if the mp3 file does not contain a Lyrics3v1 tag.

    - #### removeLyrics3v2Tag

          public void removeLyrics3v2Tag()
                                  throws java.io.IOException

      remove the `Lyrics3v2 tag` at the end of the .mp3 file. This method simply truncates the end of the .mp3 file to remove the Lyrics3v2 tag, and hence does not require a call to the `MP3.save()` method. It does not save any changes to the ID3v2.x tag. Since the Lyrics3v2 tag is found after the mpeg audio and before the `ID3v1 tag` at the end of the .mp3 file, removing the Lyrics3v2 tag from the .mp3 file will also remove the ID3v1 tag as well.
      Throws:
        `java.io.IOException` - if there was an error truncating `Lyrics3v2 tag` from the end of the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and is therefore considered to be read only and thus may not be modified, or if the mp3 file does not contain a Lyrics3v2 tag.

    - #### removeAPETag

          public void removeAPETag()
                            throws java.io.IOException

      remove the `APE tag` at the end of the .mp3 file. This method simply truncates the end of the .mp3 file to remove the APE tag, and hence does not require a call to the `MP3.save()` method. It does not save any changes to the ID3v2.x tag. Since the APE tag is found after the mpeg audio and before the `ID3v1 tag`, if present, at the end of the .mp3 file, removing the APE tag from the end of the .mp3 file will also remove the ID3v1 tag, if it is present, as well.
      Throws:
        `java.io.IOException` - if there was an error truncating `APE tag` from the end of the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and is therefore considered to be read only and thus may not be modified, or if the mp3 file does not contain an APE tag.

    - #### removeID3v24TagAtEnd

          public void removeID3v24TagAtEnd()
                                    throws java.io.IOException

      remove the `ID3v2.4 tag` at the end of the .mp3 file. If the ID3v2.4 tag is not found at the absolute very end of the .mp3 file, then no action is taken and the .mp3 file is left untouched.
      Throws:
        `java.io.IOException` - if there was an error truncating `ID3v2.4 tag` from the end of the .mp3 file.
        `java.lang.IllegalStateException` - if the mp3 song was loaded from a URL and is therefore considered to be read only and thus may not be modified.

    - #### getID3v2xPadding

          public int getID3v2xPadding()

      gets the size of the padding inside the ID3v2.x tag.
      Returns:
        the size of the padding, in bytes, inside the ID3v2.x tag.
      See Also:
        `setID3v2xPadding(int)`

    - #### setID3v2xPadding

          public void setID3v2xPadding(int newPaddingSize)
                                throws java.io.IOException

      this method sets the padding inside the ID3v2.x tag to the specified amount and saves the .mp3 file. If the .mp3 file has an ID3v2.4 tag which itself contains a footer, then the padding will not be set, as padding and the footer are mutually exclusive.
      Parameters:
        `newPaddingSize` - the new size, in bytes, that the ID3v2.x padding should be set to.
      Throws:
        `java.io.IOException` - if an error occurs while saving the .mp3 file.
      See Also:
        `getID3v2xPadding()`

    - #### saveID3v23

          protected void saveID3v23()
                             throws java.io.IOException

      save the `ID3v2.3 tag` to the .mp3 file. This is a very messy method, and you really have to understand the ID3v2.3 structure to understand this method. So, if you can, by all means, avoid reading the code in this method.
      Throws:
        `java.io.IOException` - if there was an error writing the `ID3v2.3 tag` to the .mp3 file.

    - #### saveID3v24

          protected void saveID3v24()
                             throws java.io.IOException

      save the `ID3v2.4 tag` to the .mp3 file. This is a very messy method, and you really have to understand the ID3v2.4 structure to understand this method. So, if you can, by all means, avoid reading the code in this method.
      Throws:
        `java.io.IOException` - if there was an error writing the `ID3v2.4 tag` to the .mp3 file.

    - #### toString

          public java.lang.String toString()

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