Class SampleRateConverter
- java.lang.Object
-
- com.sedmelluq.lava.common.natives.NativeResourceHolder
-
- com.sedmelluq.discord.lavaplayer.natives.samplerate.SampleRateConverter
-
public class SampleRateConverter extends com.sedmelluq.lava.common.natives.NativeResourceHolderSample rate converter backed by libsamplerate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSampleRateConverter.ProgressProgress of converting one piece of datastatic classSampleRateConverter.ResamplingTypeAvailable resampling types
-
Constructor Summary
Constructors Constructor Description SampleRateConverter(SampleRateConverter.ResamplingType type, int channels, int sourceRate, int targetRate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfreeResources()voidprocess(float[] input, int inputOffset, int inputLength, float[] output, int outputOffset, int outputLength, boolean endOfInput, SampleRateConverter.Progress progress)voidreset()Reset the converter, makes sure previous data does not affect next incoming data
-
-
-
Constructor Detail
-
SampleRateConverter
public SampleRateConverter(SampleRateConverter.ResamplingType type, int channels, int sourceRate, int targetRate)
- Parameters:
type- Resampling typechannels- Number of channelssourceRate- Source sample ratetargetRate- Target sample rate
-
-
Method Detail
-
reset
public void reset()
Reset the converter, makes sure previous data does not affect next incoming data
-
process
public void process(float[] input, int inputOffset, int inputLength, float[] output, int outputOffset, int outputLength, boolean endOfInput, SampleRateConverter.Progress progress)- Parameters:
input- Input bufferinputOffset- Offset for input bufferinputLength- Length for input bufferoutput- Output bufferoutputOffset- Offset for output bufferoutputLength- Length for output bufferendOfInput- If this is the last piece of inputprogress- Instance that is filled with the progress
-
freeResources
protected void freeResources()
- Specified by:
freeResourcesin classcom.sedmelluq.lava.common.natives.NativeResourceHolder
-
-