![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Built-in resampler. More...
#include <roc_audio/builtin_resampler.h>

Public Member Functions | |
| BuiltinResampler (core::IArena &arena, FrameFactory &frame_factory, ResamplerProfile profile, const SampleSpec &in_spec, const SampleSpec &out_spec) | |
| Initialize. | |
| virtual bool | is_valid () const |
| Check if object is successfully constructed. | |
| virtual bool | set_scaling (size_t input_rate, size_t output_rate, float multiplier) |
| Set new resample factor. | |
| virtual const core::Slice< sample_t > & | begin_push_input () |
| Get buffer to be filled with input data. | |
| virtual void | end_push_input () |
| Commit buffer with input data. | |
| virtual size_t | pop_output (sample_t *out_data, size_t out_size) |
| Read samples from input frame and fill output frame. | |
| virtual float | n_left_to_process () const |
| How many samples were pushed but not processed yet. | |
Public Member Functions inherited from roc::audio::IResampler | |
| IResampler (core::IArena &arena) | |
| Initialization. | |
| virtual | ~IResampler () |
| Deinitialization. | |
Public Member Functions inherited from roc::core::RefCounted< IResampler, core::ArenaAllocation > | |
| RefCounted () | |
| Initialize. | |
| RefCounted (const core::ArenaAllocation &policy) | |
| Initialize. | |
| int | getref () const |
| Get reference counter. | |
| void | incref () const |
| Increment reference counter. | |
| void | decref () const |
| Decrement reference counter. | |
Additional Inherited Members | |
Protected Member Functions inherited from roc::core::ArenaAllocation | |
| IArena & | arena () const |
| Get arena. | |
| ArenaAllocation (IArena &arena) | |
| Initialize. | |
| template<class T > | |
| void | destroy (T &object) |
| Destroy object and return memory to arena. | |
Built-in resampler.
Resamples audio stream with non-integer dynamically changing factor. Implements bandlimited interpolation from this paper: https://ccrma.stanford.edu/~jos/resample/resample.pdf
This backend is quite CPU-hungry, but it maintains requested scaling factor with very high precision.
Definition at line 39 of file builtin_resampler.h.
| roc::audio::BuiltinResampler::BuiltinResampler | ( | core::IArena & | arena, |
| FrameFactory & | frame_factory, | ||
| ResamplerProfile | profile, | ||
| const SampleSpec & | in_spec, | ||
| const SampleSpec & | out_spec | ||
| ) |
Initialize.
|
virtual |
Get buffer to be filled with input data.
Implements roc::audio::IResampler.
|
virtual |
Commit buffer with input data.
Implements roc::audio::IResampler.
|
virtual |
Check if object is successfully constructed.
Implements roc::audio::IResampler.
|
virtual |
How many samples were pushed but not processed yet.
Implements roc::audio::IResampler.
|
virtual |
Read samples from input frame and fill output frame.
Implements roc::audio::IResampler.
|
virtual |
Set new resample factor.
Implements roc::audio::IResampler.