pub struct FftFixedIn<T> { /* private fields */ }
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 FftFixedIn

Parameters are:

  • sample_rate_input: Input sample rate, must be > 0.
  • sample_rate_output: Output sample rate, must be > 0.
  • chunk_size_in: length of input 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

Update the resample ratio. This is not supported by this resampler and always returns ResampleError::SyncNotAdjustable.

Update the resample ratio relative to the original one. This is not supported by this resampler and always returns ResampleError::SyncNotAdjustable.

Resample a buffer of audio to a pre-allocated output buffer. Use this in real-time applications where the unpredictable time required to allocate memory from the heap can cause glitches. If this is not a problem, you may use the process method instead. Read more

Get the maximum number of input frames per channel the resampler could require

Get the number of frames per channel needed for the next call to process_into_buffer or process Read more

Get the maximum number of channels this Resampler is configured for

Get the max number of output frames per channel

Get the number of frames per channel that will be output from the next call to process_into_buffer or process Read more

This is a convenience wrapper for process_into_buffer that allocates the output buffer with each call. For realtime applications, use process_into_buffer with a buffer allocated by output_buffer_allocate instead of this function. Read more

Convenience method for allocating an input buffer suitable for use with process_into_buffer. The buffer’s capacity is big enough to prevent allocating additional heap memory before any call to process_into_buffer regardless of the current resampling ratio. Read more

Convenience method for allocating an output buffer suitable for use with process_into_buffer. The buffer’s capacity is big enough to prevent allocating additional heap memory during any call to process_into_buffer regardless of the current resampling ratio. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.