Interface AudioDecoder
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AudioInputStreamDecoder,FlacDecoder
Interface for audio decoding.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAudio decoding target interface. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes decoder, releasing resources.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()True if decodeAll can be called more than once, each time resetting the underlying input.
-
Method Details
-
reusable
boolean reusable()True if decodeAll can be called more than once, each time resetting the underlying input. -
decodeMetadata
Decodes 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.- Throws:
IOException
-
decodeAll
Sends 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 isreusable(), decodeAll may be called again to decode the same input once more. It must not be called again if decoding has thrown an exception.- Throws:
IOException
-
close
Closes decoder, releasing resources. The decoder is automatically closed if decoding throws an exception. Closing on an already closed or terminated decoder has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-