Class WdlResampler
Fully managed resampler, based on Cockos WDL Resampler
public class WdlResampler
- Inheritance
-
WdlResampler
- Inherited Members
Constructors
WdlResampler()
Creates a new Resampler
public WdlResampler()
Methods
GetCurrentLatency()
amount of input that has been received but not yet converted to output, in seconds
public double GetCurrentLatency()
Returns
ResampleOut(Span<float>, int, int, int)
if numsamples_in < the value return by ResamplePrepare(), then it will be flushed to produce all remaining valid samples do NOT call with nsamples_in greater than the value returned from resamplerprpare()! the extra samples will be ignored. returns number of samples successfully outputted to out
public int ResampleOut(Span<float> outBuffer, int nsamples_in, int nsamples_out, int nch)
Parameters
Returns
ResamplePrepare(int, int, out Span<float>)
Prepare note that it is safe to call ResamplePrepare without calling ResampleOut (the next call of ResamplePrepare will function as normal)
public int ResamplePrepare(int out_samples, int nch, out Span<float> inbuffer)
Parameters
out_samplesintreq_samples is output samples desired if !wantInputDriven, or if wantInputDriven is input samples that we have
nchintnumber of channels
inbufferSpan<float>a span into the internal buffer where input samples should be written
Returns
- int
returns number of samples desired (put these into inbuffer)
Reset(double)
Reset
public void Reset(double fracpos = 0)
Parameters
fracposdouble
SetFeedMode(bool)
Set feed mode
public void SetFeedMode(bool wantInputDriven)
Parameters
wantInputDrivenboolif true, that means the first parameter to ResamplePrepare will specify however much input you have, not how much you want
SetFilterParms(float, float)
Sets the filter parameters used for filtercnt>0 but not sinc
public void SetFilterParms(float filterpos = 0.693, float filterq = 0.707)
Parameters
SetMode(bool, int, bool, int, int)
sets the mode if sinc set, it overrides interp or filtercnt
public void SetMode(bool interp, int filtercnt, bool sinc, int sinc_size = 64, int sinc_interpsize = 32)
Parameters
SetRates(double, double)
Set input and output rates
public void SetRates(double rate_in, double rate_out)