fm.liveswitch.Resampler Class Reference

Utility class for resampling audio data. More...

Public Member Functions

double getFactor ()
 Gets the resampling factor. More...
 
int getOutputLength (fm.liveswitch.DataBuffer input)
 Gets the length of the output given an input set. More...
 
boolean resample (fm.liveswitch.DataBuffer input, fm.liveswitch.DataBuffer output)
 Resamples the given audio buffer. More...
 
boolean resample (fm.liveswitch.DataBuffer input, fm.liveswitch.DataBuffer output, boolean lastBatch)
 Resamples the given audio buffer. More...
 
 Resampler (double factor)
 Initializes a new instance of the fm.liveswitch.Resampler class. More...
 
 Resampler (int sourceClockRate, int targetClockRate)
 Initializes a new instance of the fm.liveswitch.Resampler class. More...
 

Static Public Member Functions

static int getDefaultLowPassOrder ()
 Gets the default low pass order. More...
 
static void setDefaultLowPassOrder (int value)
 Sets the default low pass order. More...
 

Detailed Description

Utility class for resampling audio data.

Constructor & Destructor Documentation

◆ Resampler() [1/2]

fm.liveswitch.Resampler.Resampler ( double  factor)

Initializes a new instance of the fm.liveswitch.Resampler class.

Parameters
factorThe resampling factor.

◆ Resampler() [2/2]

fm.liveswitch.Resampler.Resampler ( int  sourceClockRate,
int  targetClockRate 
)

Initializes a new instance of the fm.liveswitch.Resampler class.

Parameters
sourceClockRateThe source clock rate.
targetClockRateThe target clock rate.

Member Function Documentation

◆ getDefaultLowPassOrder()

static int fm.liveswitch.Resampler.getDefaultLowPassOrder ( )
static

Gets the default low pass order.

◆ getFactor()

double fm.liveswitch.Resampler.getFactor ( )

Gets the resampling factor.

◆ getOutputLength()

int fm.liveswitch.Resampler.getOutputLength ( fm.liveswitch.DataBuffer  input)

Gets the length of the output given an input set.

Parameters
inputThe input.

◆ resample() [1/2]

boolean fm.liveswitch.Resampler.resample ( fm.liveswitch.DataBuffer  input,
fm.liveswitch.DataBuffer  output 
)

Resamples the given audio buffer.

Parameters
inputThe input to resample.
outputThe output to target.

◆ resample() [2/2]

boolean fm.liveswitch.Resampler.resample ( fm.liveswitch.DataBuffer  input,
fm.liveswitch.DataBuffer  output,
boolean  lastBatch 
)

Resamples the given audio buffer.

Parameters
inputThe input to resample.
outputThe output to target.
lastBatchWhether or not this is the last batch. If
true
, input will be read to the end.
Returns
true
if the resampling operation was successful; otherwise,
false
.

◆ setDefaultLowPassOrder()

static void fm.liveswitch.Resampler.setDefaultLowPassOrder ( int  value)
static

Sets the default low pass order.