FMLiveSwitchResampler Class Reference

Utility class for resampling audio data. More...

Instance Methods

(double) - factor
 Gets the resampling factor. More...
 
(int) - getOutputLengthWithInput:
 Gets the length of the output given an input set. More...
 
(instancetype) - initWithFactor:
 Initializes a new instance of the FMLiveSwitchResampler class. More...
 
(instancetype) - initWithSourceClockRate:targetClockRate:
 Initializes a new instance of the FMLiveSwitchResampler class. More...
 
(bool) - resampleWithInput:output:
 Resamples the given audio buffer. More...
 
(bool) - resampleWithInput:output:lastBatch:
 Resamples the given audio buffer. More...
 

Class Methods

(int) + defaultLowPassOrder
 Gets the default low pass order. More...
 
(FMLiveSwitchResampler *) + resamplerWithFactor:
 Initializes a new instance of the FMLiveSwitchResampler class. More...
 
(FMLiveSwitchResampler *) + resamplerWithSourceClockRate:targetClockRate:
 Initializes a new instance of the FMLiveSwitchResampler class. More...
 
(void) + setDefaultLowPassOrder:
 Sets the default low pass order. More...
 

Detailed Description

Utility class for resampling audio data.

Method Documentation

◆ defaultLowPassOrder

+ (int) defaultLowPassOrder

Gets the default low pass order.

◆ factor

- (double) factor

Gets the resampling factor.

◆ getOutputLengthWithInput:

- (int) getOutputLengthWithInput: (FMLiveSwitchDataBuffer *)  input

Gets the length of the output given an input set.

Parameters
inputThe input.

◆ initWithFactor:

- (instancetype) initWithFactor: (double)  factor

Initializes a new instance of the FMLiveSwitchResampler class.

Parameters
factorThe resampling factor.

◆ initWithSourceClockRate:targetClockRate:

- (instancetype) initWithSourceClockRate: (int)  sourceClockRate
targetClockRate: (int)  targetClockRate 

Initializes a new instance of the FMLiveSwitchResampler class.

Parameters
sourceClockRateThe source clock rate.
targetClockRateThe target clock rate.

◆ resamplerWithFactor:

+ (FMLiveSwitchResampler*) resamplerWithFactor: (double)  factor

Initializes a new instance of the FMLiveSwitchResampler class.

Parameters
factorThe resampling factor.

◆ resamplerWithSourceClockRate:targetClockRate:

+ (FMLiveSwitchResampler*) resamplerWithSourceClockRate: (int)  sourceClockRate
targetClockRate: (int)  targetClockRate 

Initializes a new instance of the FMLiveSwitchResampler class.

Parameters
sourceClockRateThe source clock rate.
targetClockRateThe target clock rate.

◆ resampleWithInput:output:

- (bool) resampleWithInput: (FMLiveSwitchDataBuffer *)  input
output: (FMLiveSwitchDataBuffer *)  output 

Resamples the given audio buffer.

Parameters
inputThe input to resample.
outputThe output to target.

◆ resampleWithInput:output:lastBatch:

- (bool) resampleWithInput: (FMLiveSwitchDataBuffer *)  input
output: (FMLiveSwitchDataBuffer *)  output
lastBatch: (bool)  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:

+ (void) setDefaultLowPassOrder: (int)  value

Sets the default low pass order.