A multi-channel real-time resampling container that can be used to resample audio processing to a specified sample rate for the situation where you have some arbitary DSP code that requires a specific rate.
More...
|
| RealtimeResampler (double innerSampleRate, ESRCMode mode=ESRCMode::kLancsoz) |
| Constructor. More...
|
|
| RealtimeResampler (const RealtimeResampler &)=delete |
|
RealtimeResampler & | operator= (const RealtimeResampler &)=delete |
|
void | Reset (double inputSampleRate, int maxBlockSize=DEFAULT_BLOCK_SIZE) |
| Reset the underlying DSP (when the samplerate or max expected block size changes) More...
|
|
void | ProcessBlock (T **inputs, T **outputs, int nFrames, int nChans, BlockProcessFunc func) |
| Resample an input block with a per-block function (resample input -> process with function -> resample back to external sample rate) More...
|
|
int | GetLatency () const |
| Get the latency of the resampling, not including any latency of the encapsulated DSP. More...
|
|
template<typename T = double, int NCHANS = 2, size_t A = 12>
class RealtimeResampler< T, NCHANS, A >
A multi-channel real-time resampling container that can be used to resample audio processing to a specified sample rate for the situation where you have some arbitary DSP code that requires a specific rate.
Two modes are supported:
- Linear interpolation: simple linear interpolation between samples
- Lanczos resampling uses an approximation of the sinc function to interpolate between samples. This is the highest quality resampling mode.
The Lanczos resampler has a configurable filter size (A) that affects the latency of the resampler. It can also optionally use SIMD instructions when T==float.
- Template Parameters
-
T | the sampletype float or double |
NCHANS | the number of channels |
A | The Lanczos filter size for the LanczosResampler resampler mode A higher value makes the filter closer to an ideal stop-band that rejects high-frequency content (anti-aliasing), but at the expense of higher latency |
Definition at line 44 of file RealtimeResampler.h.