Resamples audio data from one sample rate to another.
More...
#include <Resampler.hpp>
|
| Resampler () |
| Creates a Resampler instance.
|
|
| ~Resampler () |
| Resampler destructor.
|
|
uint | process (const AudioBuffer< int16 > &input, AudioBuffer< int16 > &output, const uint inputSampleRate, const uint outputSampleRate) |
| Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
|
|
uint | process (const AudioBuffer< float > &input, AudioBuffer< float > &output, const uint inputSampleRate, const uint outputSampleRate) |
| Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
|
|
uint | process (const int16 *input, float *output, uint inputSampleRate, uint outputSampleRate, uint numberOfInputFrames, uint maxNumberOfOutputFrames, uint numChannels, bool endOfInput=false) |
| Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
|
|
uint | process (const float *input, float *output, uint inputSampleRate, uint outputSampleRate, uint numberOfInputFrames, uint maxNumberOfOutputFrames, uint numChannels, bool endOfInput=false) |
| Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
|
|
void | reset () |
| Resets the resampler after endOfInput is set to true in the process method. Needs to be called before a new stream of data is input to the process method.
|
|
Resamples audio data from one sample rate to another.
Resampler class.
◆ process() [1/4]
uint switchboard::Resampler::process |
( |
const AudioBuffer< float > & |
input, |
|
|
AudioBuffer< float > & |
output, |
|
|
const uint |
inputSampleRate, |
|
|
const uint |
outputSampleRate |
|
) |
| |
Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
- Parameters
-
input | The float input buffer that needs to be resampled. Either interleaved stereo or mono. |
output | The resampled output buffer. Interleaved stereo. Should not be the same as output. |
inputSampleRate | The sample rate of the input buffer. |
outputSampleRate | The target sample rate of the output buffer. |
- Returns
- The number of frames in the resampled output buffer.
◆ process() [2/4]
uint switchboard::Resampler::process |
( |
const AudioBuffer< int16 > & |
input, |
|
|
AudioBuffer< int16 > & |
output, |
|
|
const uint |
inputSampleRate, |
|
|
const uint |
outputSampleRate |
|
) |
| |
Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
- Parameters
-
input | The short input buffer that needs to be resampled. Either interleaved stereo or mono. |
output | The resampled output buffer. Interleaved stereo. Should not be the same as output. |
inputSampleRate | The sample rate of the input buffer. |
outputSampleRate | The target sample rate of the output buffer. |
- Returns
- The number of frames in the resampled output buffer.
◆ process() [3/4]
uint switchboard::Resampler::process |
( |
const float * |
input, |
|
|
float * |
output, |
|
|
uint |
inputSampleRate, |
|
|
uint |
outputSampleRate, |
|
|
uint |
numberOfInputFrames, |
|
|
uint |
maxNumberOfOutputFrames, |
|
|
uint |
numChannels, |
|
|
bool |
endOfInput = false |
|
) |
| |
Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
- Parameters
-
input | The float input buffer that needs to be resampled. Either interleaved stereo or mono. |
output | The resampled output buffer. Interleaved stereo. Should not be the same as output. |
inputSampleRate | The sample rate of the input buffer. |
outputSampleRate | The target sample rate of the output buffer. |
numberOfInputFrames | Number of frames in the input. |
maxNumberOfOutputFrames | Max number of frames in the output. Derived from the sample rate ratio. |
numChannels | Indicates the number of channels. |
endOfInput | Optional - Signals the end of input in a stream of input buffers. Resampler needs to be reset after it is set to true. |
- Returns
- The number of frames in the resampled output buffer.
◆ process() [4/4]
uint switchboard::Resampler::process |
( |
const int16 * |
input, |
|
|
float * |
output, |
|
|
uint |
inputSampleRate, |
|
|
uint |
outputSampleRate, |
|
|
uint |
numberOfInputFrames, |
|
|
uint |
maxNumberOfOutputFrames, |
|
|
uint |
numChannels, |
|
|
bool |
endOfInput = false |
|
) |
| |
Resamples an input buffer of sampling rate N, to an output buffer of sampling rate M.
- Parameters
-
input | The short input buffer that needs to be resampled. Either interleaved stereo or mono. |
output | The resampled output buffer. Interleaved stereo. Should not be the same as output. |
inputSampleRate | The sample rate of the input buffer. |
outputSampleRate | The target sample rate of the output buffer. |
numberOfInputFrames | Number of frames in the input. |
maxNumberOfOutputFrames | Max number of frames in the output. Derived from the sample rate ratio. |
numChannels | Indicates the number of channels. |
endOfInput | Optional - Signals the end of input in a stream of input buffers. Resampler needs to be reset after it is set to true. |
- Returns
- The number of frames in the resampled output buffer.
The documentation for this class was generated from the following files:
- /Users/jenkins/.jenkins/workspace/Switchboard Developer Site - Production/SwitchboardSDK/src/all/Resampler/Resampler.hpp
- /Users/jenkins/.jenkins/workspace/Switchboard Developer Site - Production/SwitchboardSDK/src/all/Resampler/Resampler.cpp