Class ExternalDecoder

java.lang.Object
net.avadeaux.klipspringer.codec.ExternalDecoder
All Implemented Interfaces:
Closeable, AutoCloseable, AudioDecoder
Direct Known Subclasses:
FlacDecoder, OpusDecoder, VorbisDecoder

public abstract class ExternalDecoder extends Object implements AudioDecoder
Common base class for decoders that invoke native libraries.
  • Method Details

    • reusable

      public boolean reusable()
      Always returns true, indicating that decodeAll can be called more than once, each time resetting the underlying input.
      Specified by:
      reusable in interface AudioDecoder
    • close

      public void close() throws IOException
      Description copied from interface: AudioDecoder
      Specified by:
      close in interface AudioDecoder
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • decodeMetadata

      public void decodeMetadata() throws IOException
      Description copied from interface: AudioDecoder
      Decodes metadata and sends it to the target, without writing any blocks. Must be called at most once, and never after decodeAll. If this is not called, metadata gets sent to the target by decodeAll.
      Specified by:
      decodeMetadata in interface AudioDecoder
      Throws:
      IOException
    • decodeAll

      public boolean decodeAll(long fromFrame) throws IOException
      Description copied from interface: AudioDecoder
      Sends audio data to the target, one block at the time, starting from the given sample frame (zero to start at the beginning). If AudioDecoder.decodeMetadata() has not been called, metadata is sent to the target before the first block. Returns when the input is exhausted (in which case it returns true) or the target aborts decoding by returning false from write (in which case this method returns false). In either case, if this decoder is AudioDecoder.reusable(), decodeAll may be called again to once more decode part of the same file.
      Specified by:
      decodeAll in interface AudioDecoder
      Throws:
      IOException