pub trait VecResampler<T>: Send {
    fn process(
        &mut self,
        wave_in: &[Vec<T>],
        active_channels_mask: Option<&[bool]>
    ) -> ResampleResult<Vec<Vec<T>>>;
fn process_into_buffer(
        &mut self,
        wave_in: &[Vec<T>],
        wave_out: &mut [Vec<T>],
        active_channels_mask: Option<&[bool]>
    ) -> ResampleResult<()>;
fn input_buffer_allocate(&self) -> Vec<Vec<T>>;
fn input_frames_max(&self) -> usize;
fn input_frames_next(&self) -> usize;
fn nbr_channels(&self) -> usize;
fn output_buffer_allocate(&self) -> Vec<Vec<T>>;
fn output_frames_max(&self) -> usize;
fn output_frames_next(&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

This is a helper trait that can be used when a Resampler must be object safe.

It differs from Resampler only by fixing the type of the input of process() and process_into_buffer to &[Vec<T>]. This allows it to be made into a trait object like this:

let boxed: Box<dyn VecResampler<f64>> = Box::new(FftFixedIn::<f64>::new(44100, 88200, 1024, 2, 2).unwrap());

Use this implementation as an example if you need to fix the input type to something else.

Required methods

Implementors