Class JSPISoundHandle.Decoder

java.lang.Object
net.mtrop.doom.struct.io.JSPISoundHandle.Decoder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
JSPISoundHandle

public class JSPISoundHandle.Decoder extends Object implements AutoCloseable
Decoder class that decodes sound as PCM audio.
Author:
Matthew Tropiano
  • Method Details

    • readPCMBytes

      public int readPCMBytes(byte[] b) throws IOException
      Reads a bunch of decoded bytes into the byte array.
      Parameters:
      b - the byte array.
      Returns:
      how many bytes were written.
      Throws:
      IOException - if the data can't be decompressed.
    • getFormat

      public final AudioFormat getFormat()
      Returns:
      the audio format specs.
      See Also:
    • getFileFormat

      public final AudioFileFormat getFileFormat()
      Returns:
      the audio file format specs.
      See Also:
    • getDecodedAudioFormat

      public final AudioFormat getDecodedAudioFormat()
      Returns:
      the decodedAudioFormat
    • close

      public void close() throws IOException
      Closes the decoder.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if an error occurred during close.