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.