Package net.mtrop.doom.struct.io
Class JSPISoundHandle.Decoder
java.lang.Object
net.mtrop.doom.struct.io.JSPISoundHandle.Decoder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- JSPISoundHandle
Decoder class that decodes sound as PCM audio.
- Author:
- Matthew Tropiano
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the decoder.final AudioFormat
final AudioFileFormat
final AudioFormat
int
readPCMBytes
(byte[] b) Reads a bunch of decoded bytes into the byte array.
-
Method Details
-
readPCMBytes
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
- Returns:
- the audio format specs.
- See Also:
-
getFileFormat
- Returns:
- the audio file format specs.
- See Also:
-
getDecodedAudioFormat
- Returns:
- the decodedAudioFormat
-
close
Closes the decoder.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- if an error occurred during close.
-