Photon Voice v2.53

Public Member Functions | Protected Attributes | List of all members
AudioUtil.Resampler< T > Class Template Reference

Sample-rate conversion Audio Processor. More...

Inherits IProcessor< T >.

Public Member Functions

 Resampler (int dstSize, int channels)
 Create a new Resampler instance. More...
 
T[] Process (T[] buf)
 Process a frame of data. More...
 
void Dispose ()
 

Protected Attributes

T[] frameResampled
 

Detailed Description

Sample-rate conversion Audio Processor.

This processor converts the sample-rate of the source stream. Internally, it uses AudioUtil.Resample<T>(T[], T[], int, int).

Constructor & Destructor Documentation

◆ Resampler()

Resampler ( int  dstSize,
int  channels 
)

Create a new Resampler instance.

Parameters
dstSizeFrame size of a destination frame. Determins output rate.
channelsNumber of audio channels expected in both in- and output.

Member Function Documentation

◆ Process()

T [] Process ( T[]  buf)

Process a frame of data.

Parameters
bufBuffer containing input data
Returns
Buffer containing output data or null if frame has been discarded (VAD)

Implements IProcessor< T >.