Class PcmChannelDecoder
java.lang.Object
net.avadeaux.klipspringer.codec.PcmChannelDecoder
- All Implemented Interfaces:
Closeable,AutoCloseable,AudioDecoder
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.avadeaux.klipspringer.codec.AudioDecoder
AudioDecoder.PictureTarget, AudioDecoder.Target -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()SeeCloseable.close().booleandecodeAll(long fromSampleNo) Sends audio data to the target, one block at the time, starting from the given sample frame (zero to start at the beginning).voidDecodes metadata and sends it to the target, without writing any blocks.static PcmChannelDecoderofRaw(ReadableByteChannel channel, PcmFormat format, long totalFrames, AudioDecoder.Target target) Factory method that gets a decoder for reading raw PCM format data.static PcmChannelDecoderofWav(SeekableByteChannel seekable, AudioDecoder.Target target) Factory method that gets a decoder for reading PCM format data with a WAV header.booleanreusable()Returns true if the underlying channel is seekable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.avadeaux.klipspringer.codec.AudioDecoder
quality
-
Method Details
-
reusable
public boolean reusable()Returns true if the underlying channel is seekable.- Specified by:
reusablein interfaceAudioDecoder
-
close
Description copied from interface:AudioDecoderSeeCloseable.close().- 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. Must be called at most once, and never afterdecodeAll. If this is not called, metadata gets sent to the target bydecodeAll.- 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 (zero to start at the beginning). IfAudioDecoder.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(),decodeAllmay be called again to once more decode part of the same file.- Specified by:
decodeAllin interfaceAudioDecoder- Throws:
IOException
-
ofRaw
public static PcmChannelDecoder ofRaw(ReadableByteChannel channel, PcmFormat format, long totalFrames, AudioDecoder.Target target) Factory method that gets a decoder for reading raw PCM format data. -
ofWav
public static PcmChannelDecoder ofWav(SeekableByteChannel seekable, AudioDecoder.Target target) throws IOException Factory method that gets a decoder for reading PCM format data with a WAV header.- Throws:
IOException
-