pub struct EncoderBounds {
pub sample_rate: u32,
pub hop_length: usize,
pub subsampling_factor: usize,
pub max_mel_frames: usize,
}Expand description
Encoder-derived bounds passed to Splitter::split.
Carries the model-config primitives (not derived seconds counts) so
splitters can reason in whichever unit fits them. Helpers
max_samples, align_to_samples,
and encoder_capacity_secs cover the common
derivations.
The 2 * subsampling_factor headroom that
encoder_capacity_secs subtracts mirrors the
JIT prepare loop’s subs_output_length margin — a chunk filling
max_samples() is guaranteed to fit through the subsampling stack without
padding overflow.
Fields§
§sample_rate: u32§hop_length: usize§subsampling_factor: usize§max_mel_frames: usizeImplementations§
Source§impl EncoderBounds
impl EncoderBounds
Sourcepub fn align_to_samples(&self) -> usize
pub fn align_to_samples(&self) -> usize
Sample-domain stride alignment: hop_length * subsampling_factor.
Splitters that produce frame-aligned chunks should snap boundaries to
this multiple.
Sourcepub fn max_samples(&self) -> usize
pub fn max_samples(&self) -> usize
Maximum chunk length (in samples) the encoder can ingest. Equals
(max_mel_frames - 2 * subsampling_factor) * hop_length — the headroom
subtraction matches the JIT prepare path.
Sourcepub fn encoder_capacity_secs(&self) -> f32
pub fn encoder_capacity_secs(&self) -> f32
Convenience for splitters that reason in wall-clock seconds.
Trait Implementations§
Source§impl Clone for EncoderBounds
impl Clone for EncoderBounds
Source§fn clone(&self) -> EncoderBounds
fn clone(&self) -> EncoderBounds
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncoderBounds
impl Debug for EncoderBounds
impl Copy for EncoderBounds
Auto Trait Implementations§
impl Freeze for EncoderBounds
impl RefUnwindSafe for EncoderBounds
impl Send for EncoderBounds
impl Sync for EncoderBounds
impl Unpin for EncoderBounds
impl UnsafeUnpin for EncoderBounds
impl UnwindSafe for EncoderBounds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more