Interface AudioDecoder.Target
- Enclosing interface:
AudioDecoder
public static interface AudioDecoder.Target
Audio decoding target interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Instructs the target to release any write-handling resources it holds.voidmetadata(AudioFormat format, long totalSamples) Information about format and length of the data that is to arrive with write.booleanwrite(ByteBuffer buffer) Writes a block of audio data to the target, organized in frames as specified by metadata.
-
Method Details
-
metadata
Information about format and length of the data that is to arrive with write. Called once per target. If the decoder is given a nonzero argument with decodeAll, the actual number of samples to arrive will be smaller than the total number of samples given here.- Throws:
IOException
-
write
Writes a block of audio data to the target, organized in frames as specified by metadata. The buffer is guaranteed valid for the duration of the call only. Returning true allows the decoder to continue sending more blocks until the input is exhausted. Returning false stops the decoder, but blocks may again start to arrive if the decoder is restarted by decodeAll being called again.- Throws:
IOException
-
close
Instructs the target to release any write-handling resources it holds.- Throws:
IOException
-