|
LMMS
|
A utility class for resampling interleaved audio buffers using various resampling algorithms. More...
#include <AudioResampler.h>
Classes | |
| struct | Result |
| Result of a resampling operation. More... | |
| struct | StateDeleter |
Public Types | |
| enum class | Mode { ZOH , Linear , SincFastest , SincMedium , SincBest } |
| Defines the resampling method to use. More... | |
Public Member Functions | |
| AudioResampler (Mode mode, ch_cnt_t channels=2) | |
| Constructs an AudioResampler instance. | |
| auto | process (InterleavedBufferView< const float > input, InterleavedBufferView< float > output) -> Result |
| Process a block of interleaved audio input from input and resample it into output. | |
| void | reset () |
| Resets the internal resampler state. Useful when working with unreleated pieces of audio. | |
| void | setRatio (double ratio) |
| Sets the resampling ratio to ratio. | |
| void | setRatio (sample_rate_t input, sample_rate_t output) |
| Sets the resampling ratio to output / input. | |
| auto | ratio () const -> double |
| auto | channels () const -> ch_cnt_t |
| auto | mode () const -> Mode |
Private Attributes | |
| std::unique_ptr< void, StateDeleter > | m_state |
| Mode | m_mode |
| ch_cnt_t | m_channels = 0 |
| double | m_ratio = 1.0 |
| int | m_error = 0 |
A utility class for resampling interleaved audio buffers using various resampling algorithms.
This class provides support for zero-order hold, linear, and several levels of sinc-based resampling.
|
strong |
Constructs an AudioResampler instance.
|
inline |
|
inline |
|
nodiscard |
Process a block of interleaved audio input from input and resample it into output.
| input | The interleaved audio input. |
| output | The interleaved audio output. |
| `std::invalid_argument` | if a channel mismatch has been detected. |
| `std::runtime_error` | if the resampling process has failed. |
|
inline |
| void lmms::AudioResampler::reset | ( | ) |
Resets the internal resampler state. Useful when working with unreleated pieces of audio.
|
inline |
|
inline |
Sets the resampling ratio to output / input.
| input | Input sample rate. |
| output | Output sample rate. |
|
private |
|
private |
|
private |
|
private |
|
private |