|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
resample as a stream: block by block, with the filter history kept between calls More...
#include <Resample.hpp>
Classes | |
| struct | Impl |
Public Member Functions | |
| std::vector< double > | flush () |
| End the stream. | |
| size_t | lookahead () const noexcept |
| Input samples an output reads beyond its own time, 0 for equal rates. | |
| Resampler & | operator= (const Resampler &)=delete |
| Resampler & | operator= (Resampler &&) noexcept |
| std::vector< double > | push (std::span< const double > src) |
| Continue the stream with more input. | |
| Resampler (const Resampler &)=delete | |
| Resampler (Resampler &&) noexcept | |
| Resampler (uint32_t from_rate, uint32_t to_rate, const ResampleConfig &config={}) | |
| Construct a resampler. | |
| void | reset () noexcept |
| Start a new stream without releasing anything. | |
| size_t | retained () const noexcept |
| Input samples currently held. | |
| ~Resampler () | |
Private Attributes | |
| std::unique_ptr< Impl > | m_impl |
resample as a stream: block by block, with the filter history kept between calls
Concatenating everything push returns and then flush returns gives exactly what resample returns for the concatenated input, however the input was cut into blocks, so no block edge restarts the filter. An output sample is produced as soon as the input samples it reads have arrived: each reads lookahead() input samples past its own time, which is the delay a live caller sees. flush ends the stream, supplying zeros past the last sample as resample does, and the next push starts a new stream. Equal rates pass the input through unchanged and with no delay.
Only the input the next output still needs is retained, so memory is the length of the filter however long the stream runs. Not for concurrent use.
Definition at line 81 of file Resample.hpp.