Class ResamplingPcmAudioFilter
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.filter.ResamplingPcmAudioFilter
-
- All Implemented Interfaces:
AudioFilter,FloatPcmAudioFilter
public class ResamplingPcmAudioFilter extends java.lang.Object implements FloatPcmAudioFilter
Filter which resamples audio to the specified sample rate
-
-
Constructor Summary
Constructors Constructor Description ResamplingPcmAudioFilter(AudioConfiguration configuration, int channels, FloatPcmAudioFilter downstream, int sourceRate, int targetRate)
-
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)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
-
ResamplingPcmAudioFilter
public ResamplingPcmAudioFilter(AudioConfiguration configuration, int channels, FloatPcmAudioFilter downstream, int sourceRate, int targetRate)
- Parameters:
configuration- Configuration to usechannels- Number of channels in input datadownstream- Next filter in chainsourceRate- Source sample ratetargetRate- Target sample rate
-
-
Method Detail
-
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
-
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).
-
-