Struct rubato::FftFixedIn[][src]

pub struct FftFixedIn<T> { /* fields omitted */ }
Expand description

A synchronous resampler that needs a fixed number of audio frames for input and returns a variable number of frames.

The resampling is done by FFT:ing the input data. The spectrum is then extended or truncated as well as multiplied with an antialiasing filter before it’s inverse transformed to get the resampled waveforms.

Implementations

Create a new FftFixedOut

Parameters are:

  • fs_in: Input sample rate.
  • fs_out: Output sample rate.
  • chunk_size_out: length of output data in frames.
  • sub_chunks: desired number of subchunks for processing, actual number used may be different.
  • nbr_channels: number of channels in input/output.

Trait Implementations

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

Resample a chunk of audio. The required input length is provided by the “nbr_frames_needed” function, and the output length is fixed. If the waveform for a channel is empty, this channel will be ignored and produce a corresponding empty output waveform.

Errors

The function returns an error if the length of the input data is not equal to the number of channels defined when creating the instance, and the number of audio frames given by “nbr_frames_needed”.

Update the resample ratio. This is not supported by this resampler and always returns an error.

Update the resample ratio relative to the original one. This is not supported by this resampler and always returns an error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.