[][src]Struct miniaudio::LinearResampler

#[repr(transparent)]pub struct LinearResampler(_);

Methods

impl LinearResampler[src]

pub fn new(config: &LinearResamplerConfig) -> Result<LinearResampler, Error>[src]

pub fn config(&self) -> &LinearResamplerConfig[src]

pub fn process_pcm_frames(
    &mut self,
    output: &FramesMut,
    input: &Frames
) -> Result<(u64, u64), Error>
[src]

Converts the given input data.

Returns the number of input frames that were consumed during processing and the number of output frames that were written to the output buffer respectively.

pub fn set_rate(
    &mut self,
    sample_rate_in: u32,
    sample_rate_out: u32
) -> Result<(), Error>
[src]

Sets the input and output sample rate.

pub fn set_rate_ratio(&mut self, ratio_in_out: f32) -> Result<(), Error>[src]

Sets the input and output sample rate as a ratio.

The ratio is in/out.

pub fn required_input_frame_count(&self, output_frame_count: u64) -> u64[src]

Calculates the number of whole input frames that would need to be read from the client in order to output the specified number of output frames.

The returned value does not include cached input frames. It only returns the number of extra frames that would need to be read from the input buffer in order to output the specified number of output frames.

pub fn expected_output_frame_count(&self, input_frame_count: u64) -> u64[src]

Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of input frames.

pub fn input_latency(&mut self) -> u64[src]

Retrieves the latency introduced by the resampler in input frames.

pub fn output_latency(&mut self) -> u64[src]

Retrieves the latency introduced by the resampler in output frames.

pub fn in_advance_int(&self) -> u32[src]

pub fn in_advance_frac(&self) -> u32[src]

pub fn in_time_int(&self) -> u32[src]

pub fn in_time_frac(&self) -> u32[src]

Trait Implementations

impl Clone for LinearResampler[src]

impl Drop for LinearResampler[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.