Class ChannelCountPcmAudioFilter
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.filter.ChannelCountPcmAudioFilter
-
- All Implemented Interfaces:
AudioFilter,FloatPcmAudioFilter,ShortPcmAudioFilter,SplitShortPcmAudioFilter,UniversalPcmAudioFilter
public class ChannelCountPcmAudioFilter extends java.lang.Object implements UniversalPcmAudioFilter
For short PCM buffers, guarantees that the output has the required number of channels and that no outgoing buffer contains any partial frames.For example if the input is three channels, and output is two channels, then: in [0, 1, 2, 0, 1, 2, 0, 1] out [0, 1, 0, 1] saved [0, 1] in [2, 0, 1, 2] out [0, 1, 0, 1] saved []
-
-
Constructor Summary
Constructors Constructor Description ChannelCountPcmAudioFilter(int inputChannels, int outputChannels, UniversalPcmAudioFilter downstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Free all resources.voidflush()Flush everything to output.voidprocess(float[][] input, int offset, int length)voidprocess(short[][] input, int offset, int length)voidprocess(short[] input, int offset, int length)voidprocess(java.nio.ShortBuffer buffer)voidseekPerformed(long requestedTime, long providedTime)Indicates that the next samples are not a continuation from the previous ones and gives the timecode for the next incoming sample.
-
-
-
Constructor Detail
-
ChannelCountPcmAudioFilter
public ChannelCountPcmAudioFilter(int inputChannels, int outputChannels, UniversalPcmAudioFilter downstream)- Parameters:
inputChannels- Number of input channelsoutputChannels- Number of output channelsdownstream- The next filter in line
-
-
Method Detail
-
process
public void process(short[] input, int offset, int length) throws java.lang.InterruptedException- Specified by:
processin interfaceShortPcmAudioFilter- Parameters:
input- Array of samplesoffset- Offset in the arraylength- Length of the sequence in the array- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
process
public void process(java.nio.ShortBuffer buffer) throws java.lang.InterruptedException- Specified by:
processin interfaceShortPcmAudioFilter- Parameters:
buffer- The buffer of samples- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
process
public void process(float[][] input, int offset, int length) throws java.lang.InterruptedException- Specified by:
processin interfaceFloatPcmAudioFilter- Parameters:
input- An array of samples for each channeloffset- Offset in the arrays to start atlength- Length of the target sequence in arrays- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
process
public void process(short[][] input, int offset, int length) throws java.lang.InterruptedException- Specified by:
processin interfaceSplitShortPcmAudioFilter- Parameters:
input- An array of samples for each channeloffset- Offset in the arraylength- Length of the sequence in the array- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
seekPerformed
public void seekPerformed(long requestedTime, long providedTime)Description copied from interface:AudioFilterIndicates that the next samples are not a continuation from the previous ones and gives the timecode for the next incoming sample.- Specified by:
seekPerformedin interfaceAudioFilter- Parameters:
requestedTime- Timecode in milliseconds to which the seek was requested toprovidedTime- Timecode in milliseconds to which the seek was actually performed to
-
flush
public void flush() throws java.lang.InterruptedExceptionDescription copied from interface:AudioFilterFlush everything to output.- Specified by:
flushin interfaceAudioFilter- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
close
public void close()
Description copied from interface:AudioFilterFree all resources. No more input is expected.- Specified by:
closein interfaceAudioFilter
-
-