[][src]Struct ac_ffmpeg::codec::audio::resampler::AudioResampler

pub struct AudioResampler { /* fields omitted */ }

Audio resampler.

Resampler operation

  1. Push an audio frame to the resampler.
  2. Take all frames from the resampler until you get None.
  3. If there are more frames to be resampled, continue with 1.
  4. Flush the resampler.
  5. Take all frames from the resampler until you get None.

Timestamps of the output frames will be in 1 / target_sample_rate time base.

Implementations

impl AudioResampler[src]

pub fn builder() -> AudioResamplerBuilder[src]

Get a builder for the audio resampler.

pub fn push(&mut self, frame: AudioFrame) -> Result<(), Error>[src]

Push a given frame to the resampler.

Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

pub fn try_push(&mut self, frame: AudioFrame) -> Result<(), CodecError>[src]

Push a given frame to the resampler.

pub fn flush(&mut self) -> Result<(), Error>[src]

Flush the resampler.

Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

pub fn try_flush(&mut self) -> Result<(), CodecError>[src]

Flush the resampler.

pub fn take(&mut self) -> Result<Option<AudioFrame>, Error>[src]

Take a frame from the resampler (if available).

Trait Implementations

impl Drop for AudioResampler[src]

impl Send for AudioResampler[src]

impl Sync for AudioResampler[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, 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.