pub struct GaplessTrimmer { /* private fields */ }Expand description
Stateful PCM trimmer that applies one track’s gapless contract.
Implementations§
Source§impl GaplessTrimmer
impl GaplessTrimmer
Sourcepub fn codec_priming(leading_frames: u64, sample_rate: u32) -> Self
pub fn codec_priming(leading_frames: u64, sample_rate: u32) -> Self
Build a trimmer that drops a fixed number of leading frames looked up from a codec table. The boundary is by definition approximate, so a short raised-cosine fade-in is applied to the first frames of audible output to avoid clicks.
sample_rate is needed to size the fade-in in frames.
pub fn disabled() -> Self
pub fn flush(&mut self) -> GaplessOutput
Sourcepub fn notify_seek(&mut self)
pub fn notify_seek(&mut self)
Drop seek-sensitive state. Both heuristic search and pending fade-in are abandoned: after a seek we land mid-track and trying to “trim leading silence” or apply a fade-in there would corrupt audible content.
pub fn push(&mut self, chunk: PcmChunk) -> GaplessOutput
Sourcepub fn silence_trim(params: SilenceTrimParams) -> Self
pub fn silence_trim(params: SilenceTrimParams) -> Self
Build a silence-scan trimmer. Trim boundaries are inferred by scanning samples; a fade-in is applied after the boundary is found to mask the level jump.
Trait Implementations§
Source§impl Debug for GaplessTrimmer
impl Debug for GaplessTrimmer
Source§impl Default for GaplessTrimmer
impl Default for GaplessTrimmer
Source§fn default() -> GaplessTrimmer
fn default() -> GaplessTrimmer
Returns the “default value” for a type. Read more
Source§impl From<GaplessInfo> for GaplessTrimmer
impl From<GaplessInfo> for GaplessTrimmer
Source§fn from(info: GaplessInfo) -> Self
fn from(info: GaplessInfo) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GaplessTrimmer
impl !RefUnwindSafe for GaplessTrimmer
impl Send for GaplessTrimmer
impl Sync for GaplessTrimmer
impl Unpin for GaplessTrimmer
impl UnsafeUnpin for GaplessTrimmer
impl !UnwindSafe for GaplessTrimmer
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