Provides a callback function that is called with resampled audio data. More...
#include <IOResampler.hpp>
Public Member Functions | |
IOResampler (const uint sourceSampleRate, const uint callbackSampleRate, const IOResamplerCallbackFunction callback) | |
Creates an IOResampler instance. | |
bool | process (float **buffers, const bool inputIsMono, const uint numberOfFrames, void *userPointer) |
Audio process function of IOResampler. | |
Provides a callback function that is called with resampled audio data.
IOResampler class.
Supports mono and stereo input and stereo output.
The IOResampler contains two resamplers and it works like this:
[Input audio @ source sample rate] - [Resampler] - [Callback function @ callback sample rate] - [Resampler] - [Output audio @ source sample rate]
Number of frames is never changed during the process call. Returned audio data might contain zero values initially.
switchboard::IOResampler::IOResampler | ( | const uint | sourceSampleRate, |
const uint | callbackSampleRate, | ||
const IOResamplerCallbackFunction | callback | ||
) |
Creates an IOResampler instance.
sourceSampleRate | The source sample rate. |
callbackSampleRate | The sample rate of the audio data that will be passed to the callback function. |
callback | The callback function that processed the resampled audio data. |
bool switchboard::IOResampler::process | ( | float ** | buffers, |
const bool | inputIsMono, | ||
const uint | numberOfFrames, | ||
void * | userPointer | ||
) |
Audio process function of IOResampler.
buffers | [inout] The buffers containing the audio data. |
inputIsMono | Must be true if the buffers parameter contains mono data, false otherwise. |
numberOfFrames | Number of frames in the buffers parameter. |
userPointer | Custom pointer value that will be passed to the callback function. |