Class Mp3StreamSeeker

  • All Implemented Interfaces:
    Mp3Seeker

    public class Mp3StreamSeeker
    extends java.lang.Object
    implements Mp3Seeker
    Seeker for an MP3 stream, which actually does not allow seeking and reports UnitConstants.DURATION_MS_UNKNOWN as duration.
    • Constructor Detail

      • Mp3StreamSeeker

        public Mp3StreamSeeker()
    • Method Detail

      • getDuration

        public long getDuration()
        Specified by:
        getDuration in interface Mp3Seeker
        Returns:
        The duration of the file in milliseconds. May be an estimate.
      • isSeekable

        public boolean isSeekable()
        Specified by:
        isSeekable in interface Mp3Seeker
        Returns:
        True if the track is seekable.
      • seekAndGetFrameIndex

        public long seekAndGetFrameIndex​(long timecode,
                                         SeekableInputStream inputStream)
                                  throws java.io.IOException
        Specified by:
        seekAndGetFrameIndex in interface Mp3Seeker
        Parameters:
        timecode - The timecode that the seek is requested to
        inputStream - The input stream to perform the seek on
        Returns:
        The index of the frame that the seek was performed to
        Throws:
        java.io.IOException - On IO error