Interface AudioDecoder.Target

Enclosing interface:
AudioDecoder

public static interface AudioDecoder.Target
Audio decoding target interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Instructs the target to release any write-handling resources it holds.
    void
    metadata(AudioFormat format, long totalSamples)
    Information about format and length of the data that is to arrive with write.
    boolean
    write(ByteBuffer buffer)
    Writes a block of audio data to the target, organized in frames as specified by metadata.
  • Method Details

    • metadata

      void metadata(AudioFormat format, long totalSamples) throws IOException
      Information about format and length of the data that is to arrive with write. Called once per target. If the decoder is given a nonzero argument with decodeAll, the actual number of samples to arrive will be smaller than the total number of samples given here.
      Throws:
      IOException
    • write

      boolean write(ByteBuffer buffer) throws IOException
      Writes a block of audio data to the target, organized in frames as specified by metadata. The buffer is guaranteed valid for the duration of the call only. Returning true allows the decoder to continue sending more blocks until the input is exhausted. Returning false stops the decoder, but blocks may again start to arrive if the decoder is restarted by decodeAll being called again.
      Throws:
      IOException
    • close

      void close() throws IOException
      Instructs the target to release any write-handling resources it holds.
      Throws:
      IOException