[−][src]Struct rubato::FftFixedInOut
A synchronous resampler that accepts a fixed number of audio frames for input and returns a fixed 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
impl FftFixedInOut<f64>
[src]
pub fn new(
fs_in: usize,
fs_out: usize,
chunk_size_in: usize,
nbr_channels: usize
) -> Self
[src]
fs_in: usize,
fs_out: usize,
chunk_size_in: usize,
nbr_channels: usize
) -> Self
Create a new FftFixedInOut
Parameters are:
fs_in
: Input sample rate.fs_out
: Output sample rate.chunk_size_in
: desired length of input data in frames, actual value may be different.nbr_channels
: number of channels in input/output.
impl FftFixedInOut<f32>
[src]
pub fn new(
fs_in: usize,
fs_out: usize,
chunk_size_in: usize,
nbr_channels: usize
) -> Self
[src]
fs_in: usize,
fs_out: usize,
chunk_size_in: usize,
nbr_channels: usize
) -> Self
Create a new FftFixedInOut
Parameters are:
fs_in
: Input sample rate.fs_out
: Output sample rate.chunk_size_in
: desired length of input data in frames, actual value may be different.nbr_channels
: number of channels in input/output.
Trait Implementations
impl Resampler<f32> for FftFixedInOut<f32>
[src]
fn nbr_frames_needed(&self) -> usize
[src]
Query for the number of frames needed for the next call to "process".
fn set_resample_ratio(&mut self, _new_ratio: f64) -> Result<(), Box<dyn Error>>
[src]
Update the resample ratio. This is not supported by this resampler and always returns an error.
fn set_resample_ratio_relative(
&mut self,
_rel_ratio: f64
) -> Result<(), Box<dyn Error>>
[src]
&mut self,
_rel_ratio: f64
) -> Result<(), Box<dyn Error>>
Update the resample ratio relative to the original one. This is not supported by this resampler and always returns an error.
fn process(
&mut self,
wave_in: &[Vec<f32>]
) -> Result<Vec<Vec<f32>>, Box<dyn Error>>
[src]
&mut self,
wave_in: &[Vec<f32>]
) -> Result<Vec<Vec<f32>>, Box<dyn Error>>
Resample a chunk of audio. The input and output lengths are fixed.
Errors
The function returns an error if the size of the input data is not equal to the number of channels and input size defined when creating the instance.
impl Resampler<f64> for FftFixedInOut<f64>
[src]
fn nbr_frames_needed(&self) -> usize
[src]
Query for the number of frames needed for the next call to "process".
fn set_resample_ratio(&mut self, _new_ratio: f64) -> Result<(), Box<dyn Error>>
[src]
Update the resample ratio. This is not supported by this resampler and always returns an error.
fn set_resample_ratio_relative(
&mut self,
_rel_ratio: f64
) -> Result<(), Box<dyn Error>>
[src]
&mut self,
_rel_ratio: f64
) -> Result<(), Box<dyn Error>>
Update the resample ratio relative to the original one. This is not supported by this resampler and always returns an error.
fn process(
&mut self,
wave_in: &[Vec<f64>]
) -> Result<Vec<Vec<f64>>, Box<dyn Error>>
[src]
&mut self,
wave_in: &[Vec<f64>]
) -> Result<Vec<Vec<f64>>, Box<dyn Error>>
Resample a chunk of audio. The input and output lengths are fixed.
Errors
The function returns an error if the size of the input data is not equal to the number of channels and input size defined when creating the instance.
Auto Trait Implementations
impl<T> !RefUnwindSafe for FftFixedInOut<T>
impl<T> Send for FftFixedInOut<T> where
T: Send,
T: Send,
impl<T> Sync for FftFixedInOut<T> where
T: Sync,
T: Sync,
impl<T> Unpin for FftFixedInOut<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for FftFixedInOut<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,