pub struct AudioResampler { /* private fields */ }
Expand description
Audio resampler.
§Resampler operation
- Push an audio frame to the resampler.
- Take all frames from the resampler until you get None.
- If there are more frames to be resampled, continue with 1.
- Flush the resampler.
- 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§
Source§impl AudioResampler
impl AudioResampler
Sourcepub fn builder() -> AudioResamplerBuilder
pub fn builder() -> AudioResamplerBuilder
Get a builder for the audio resampler.
Sourcepub fn push(&mut self, frame: AudioFrame) -> Result<(), Error>
pub fn push(&mut self, frame: AudioFrame) -> Result<(), Error>
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).
Sourcepub fn try_push(&mut self, frame: AudioFrame) -> Result<(), CodecError>
pub fn try_push(&mut self, frame: AudioFrame) -> Result<(), CodecError>
Push a given frame to the resampler.
Sourcepub fn flush(&mut self) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
Flush the resampler.
§Panics
The method panics if the operation is not expected (i.e. another operation needs to be done).
Sourcepub fn try_flush(&mut self) -> Result<(), CodecError>
pub fn try_flush(&mut self) -> Result<(), CodecError>
Flush the resampler.
Trait Implementations§
Source§impl Drop for AudioResampler
impl Drop for AudioResampler
impl Send for AudioResampler
impl Sync for AudioResampler
Auto Trait Implementations§
impl Freeze for AudioResampler
impl RefUnwindSafe for AudioResampler
impl Unpin for AudioResampler
impl UnwindSafe for AudioResampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more