Trait rubato::Resampler[][src]

pub trait Resampler<T> {
    fn process<V: AsRef<[T]>>(
        &mut self,
        wave_in: &[V]
    ) -> ResampleResult<Vec<Vec<T>>>;
fn nbr_frames_needed(&self) -> usize;
fn set_resample_ratio(&mut self, new_ratio: f64) -> ResampleResult<()>;
fn set_resample_ratio_relative(
        &mut self,
        rel_ratio: f64
    ) -> ResampleResult<()>; }
Expand description

A resampler that us used to resample a chunk of audio to a new sample rate. The rate can be adjusted as required.

Required methods

Resample a chunk of audio.

The input data is a slice, where each element of the slice is itself referenceable as a slice (AsRef<[T]>) which contains the samples for a single channel. Since Vec<T> implements AsRef<[T]>, the input may simply be &*Vec<Vec<T>>. The output data is a vector, where each element of the vector is itself a vector which contains the samples for a single channel.

Query for the number of frames needed for the next call to “process”.

Update the resample ratio.

Update the resample ratio relative to the original one.

Implementors