Class LyricsHandler

java.lang.Object
org.apache.tika.parser.mp3.LyricsHandler

public class LyricsHandler extends Object
This is used to parse Lyrics3 tag information from an MP3 file, if available. Handles lyrics tags of up to 10kb in size. Will process any ID3v1 tag data if present. Ignores extended ID3v1 data in the lyrics block
See Also:
  • Constructor Details

    • LyricsHandler

      public LyricsHandler(InputStream stream, ContentHandler handler) throws IOException, SAXException, org.apache.tika.exception.TikaException
      Throws:
      IOException
      SAXException
      org.apache.tika.exception.TikaException
    • LyricsHandler

      protected LyricsHandler(byte[] tagData) throws IOException, SAXException, org.apache.tika.exception.TikaException
      Looks for the Lyrics data, which will be just before the ID3v1 data (if present), and process it. Also sets things up for the ID3v1 processing if required. Creates from the last 128 bytes of a stream.
      Throws:
      IOException
      SAXException
      org.apache.tika.exception.TikaException
  • Method Details

    • getSuffix

      protected static byte[] getSuffix(InputStream stream, int length) throws IOException
      Reads and returns the last length bytes from the given stream.
      Parameters:
      stream - input stream
      length - number of bytes from the end to read and return
      Returns:
      stream the InputStream to read from.
      Throws:
      IOException - if the stream could not be read from.
    • hasID3v1

      public boolean hasID3v1()
    • hasLyrics

      public boolean hasLyrics()