Class PcmChunkEncoder
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.format.transcoder.PcmChunkEncoder
-
- All Implemented Interfaces:
AudioChunkEncoder
public class PcmChunkEncoder extends java.lang.Object implements AudioChunkEncoder
Audio chunk encoder for PCM data.
-
-
Constructor Summary
Constructors Constructor Description PcmChunkEncoder(AudioDataFormat format, boolean bigEndian)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Frees up all held resources.byte[]encode(java.nio.ShortBuffer buffer)voidencode(java.nio.ShortBuffer buffer, java.nio.ByteBuffer out)
-
-
-
Constructor Detail
-
PcmChunkEncoder
public PcmChunkEncoder(AudioDataFormat format, boolean bigEndian)
- Parameters:
format- Target audio format.bigEndian- Whether the samples are in big-endian format (as opposed to little-endian).
-
-
Method Detail
-
encode
public byte[] encode(java.nio.ShortBuffer buffer)
- Specified by:
encodein interfaceAudioChunkEncoder- Parameters:
buffer- Input buffer containing the PCM samples.- Returns:
- Encoded bytes
-
encode
public void encode(java.nio.ShortBuffer buffer, java.nio.ByteBuffer out)- Specified by:
encodein interfaceAudioChunkEncoder- Parameters:
buffer- Input buffer containing the PCM samples.out- Output buffer to store the encoded bytes in
-
close
public void close()
Description copied from interface:AudioChunkEncoderFrees up all held resources.- Specified by:
closein interfaceAudioChunkEncoder
-
-