Class AudioInputStreamDecoder
java.lang.Object
net.avadeaux.klipspringer.decoder.AudioInputStreamDecoder
- All Implemented Interfaces:
Closeable,AutoCloseable,AudioDecoder
Audio decoder that reads from an AudioInputStream.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.avadeaux.klipspringer.decoder.AudioDecoder
AudioDecoder.Target -
Constructor Summary
ConstructorsConstructorDescriptionAudioInputStreamDecoder(AudioInputStream stream, AudioDecoder.Target target) Sets up for sending data from the given AudioInputStream to the given target. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes stream.booleandecodeAll(long fromSampleNo) Sends audio data to the target, one block at the time, starting from the given sample frame number (zero to start at the beginning).voidDecodes metadata and sends it to the target, without writing any blocks.booleanreusable()Returns false, indicating that decodeAll can be called at most once.
-
Constructor Details
-
AudioInputStreamDecoder
Sets up for sending data from the given AudioInputStream to the given target.
-
-
Method Details
-
reusable
public boolean reusable()Returns false, indicating that decodeAll can be called at most once.- Specified by:
reusablein interfaceAudioDecoder
-
close
Closes stream.- Specified by:
closein interfaceAudioDecoder- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
decodeMetadata
Description copied from interface:AudioDecoderDecodes metadata and sends it to the target, without writing any blocks. Should be called at most once, and never after decodeAll. If not called, metadata gets sent to the target by decodeAll.- Specified by:
decodeMetadatain interfaceAudioDecoder- Throws:
IOException
-
decodeAll
Description copied from interface:AudioDecoderSends audio data to the target, one block at the time, starting from the given sample frame number (zero to start at the beginning). If 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 isAudioDecoder.reusable(), decodeAll may be called again to decode the same input once more. It must not be called again if decoding has thrown an exception.- Specified by:
decodeAllin interfaceAudioDecoder- Throws:
IOException
-