|
VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
|
#include <TResamplerLinear.hpp>
Public Member Functions | |
| ResamplerLinearTpl (uint rateIn, uint rateOut, uint maxBlock=512, uchar channels=2, uchar quality=5) | |
| ResamplerLinearTpl ()=default | |
| bool | init (uint rateIn, uint rateOut, uint maxBlock=512, uchar channels=2, uchar quality=5) |
| setup the resampler More... | |
| Size | process (const Buffer &in, Buffer &out) |
| Resample function Make sure the out buffer has enough space. More... | |
| int | getLatency () const |
| Get the latency in samples. More... | |
| Size | estimateNeed (const Size out) const |
| Estimate how many samples need to be put in to get n samples out. More... | |
| Size | estimateOut (const Size in) const |
| bool | isInitialized () const |
| Size | calculateBufferSize (Size in) |
| Calculate a buffersize fit for the resampled result. More... | |
Static Public Member Functions | |
| static void | resample (Buffer &buffer, const uint rateOut, const uchar quality=5) |
| Resamples the provided buffer from its sampleRate to the target rate. More... | |
Private Types | |
| using | uchar = unsigned char |
| using | uint = unsigned int |
| using | Size = typename Buffer::Size |
Private Attributes | |
| uint | mRateIn |
| uint | mRateOut |
| double | mFactor = 1.0 |
| T | mOffset = 0 |
| T | mLastFrame [MAX_CHANNELS] |
Static Private Attributes | |
| static constexpr Size | MAX_CHANNELS = 32 |
Definition at line 8 of file TResamplerLinear.hpp.
|
private |
Definition at line 12 of file TResamplerLinear.hpp.
|
private |
Definition at line 10 of file TResamplerLinear.hpp.
|
private |
Definition at line 11 of file TResamplerLinear.hpp.
|
inline |
Definition at line 20 of file TResamplerLinear.hpp.
|
default |
|
inline |
Calculate a buffersize fit for the resampled result.
Also adds a bit of padding.
Definition at line 115 of file TResamplerLinear.hpp.
|
inline |
Estimate how many samples need to be put in to get n samples out.
Definition at line 98 of file TResamplerLinear.hpp.
|
inline |
|
inline |
Get the latency in samples.
Definition at line 91 of file TResamplerLinear.hpp.
|
inline |
setup the resampler
| rateIn | Input sample rate |
| rateOut | Desired output samplerate |
| maxBlock | The maximum blocksize beeing passed into process(). Only relevant when doing non float resampling to allocate space for the conversion buffers |
| quality | Quality factor from 1-10. Higher results in better quality and higher CPU usage. Depending on implementataion may not do anything. |
Definition at line 37 of file TResamplerLinear.hpp.
|
inline |
Definition at line 107 of file TResamplerLinear.hpp.
|
inline |
Resample function Make sure the out buffer has enough space.
Definition at line 49 of file TResamplerLinear.hpp.
|
inlinestatic |
Resamples the provided buffer from its sampleRate to the target rate.
| buffer | Audiobuffer to resample, set the rate of the buffer object |
| rateOut | Desired output samplerate in Hz |
| quality | Quality from 1-10 |
Definition at line 126 of file TResamplerLinear.hpp.
|
staticconstexprprivate |
Definition at line 14 of file TResamplerLinear.hpp.
|
private |
Definition at line 16 of file TResamplerLinear.hpp.
|
private |
Definition at line 18 of file TResamplerLinear.hpp.
|
private |
Definition at line 17 of file TResamplerLinear.hpp.
|
private |
Definition at line 15 of file TResamplerLinear.hpp.
|
private |
Definition at line 15 of file TResamplerLinear.hpp.