pub struct AnalyzerBuilder { /* private fields */ }Expand description
Implementations§
Source§impl AnalyzerBuilder
impl AnalyzerBuilder
Sourcepub fn expected_duration(self, duration: Duration) -> Self
pub fn expected_duration(self, duration: Duration) -> Self
Hint at the expected programme length. The builder uses this to
pre-reserve internal buffers so steady-state push_* calls
trigger no allocations even with Mode::Integrated /
Mode::Lra enabled.
Over-estimating wastes a few KB; under-estimating just causes the buffer to grow as normal. This is a hint, not a hard cap.
§Example
let analyzer = AnalyzerBuilder::new()
.sample_rate(48_000)
.channels(&[Channel::Left, Channel::Right])
.modes(Mode::Integrated | Mode::Lra)
.expected_duration(Duration::from_secs(60 * 90)) // 90 minutes
.build()?;Sourcepub fn sample_rate(self, hz: u32) -> Self
pub fn sample_rate(self, hz: u32) -> Self
Set the input sample rate, in hertz. Must be one of 22 050, 32 000, 44 100, 48 000, 88 200, 96 000, 192 000.
Sourcepub fn channels(self, layout: &[Channel]) -> Self
pub fn channels(self, layout: &[Channel]) -> Self
Set the channel layout. The order must match the order of channel
slices passed to Analyzer::push_planar or the interleave
order passed to Analyzer::push_interleaved.
Trait Implementations§
Source§impl Clone for AnalyzerBuilder
impl Clone for AnalyzerBuilder
Source§fn clone(&self) -> AnalyzerBuilder
fn clone(&self) -> AnalyzerBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnalyzerBuilder
impl Debug for AnalyzerBuilder
Auto Trait Implementations§
impl Freeze for AnalyzerBuilder
impl RefUnwindSafe for AnalyzerBuilder
impl Send for AnalyzerBuilder
impl Sync for AnalyzerBuilder
impl Unpin for AnalyzerBuilder
impl UnsafeUnpin for AnalyzerBuilder
impl UnwindSafe for AnalyzerBuilder
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