pub struct DetectionConfig {
pub sample_rate: u32,
pub window_ms: f64,
pub threshold_db: f64,
pub min_gap_ms: f64,
pub refine_lookback_ms: f64,
}Expand description
Configuration for onset detection.
Fields§
§sample_rate: u32Sample rate in Hz (e.g., 48000)
window_ms: f64RMS window size in milliseconds (default: 10ms)
threshold_db: f64Energy threshold in dB (default: -40.0)
min_gap_ms: f64Minimum gap between onsets in milliseconds (default: 200ms)
refine_lookback_ms: f64Look-back for onset refinement in milliseconds (default: 5ms)
Implementations§
Source§impl DetectionConfig
impl DetectionConfig
Sourcepub fn with_sample_rate(self, sample_rate: u32) -> Self
pub fn with_sample_rate(self, sample_rate: u32) -> Self
Create a new detection config with the given sample rate.
Sourcepub fn with_threshold_db(self, threshold_db: f64) -> Self
pub fn with_threshold_db(self, threshold_db: f64) -> Self
Set the energy threshold in dB.
Sourcepub fn with_min_gap_ms(self, min_gap_ms: f64) -> Self
pub fn with_min_gap_ms(self, min_gap_ms: f64) -> Self
Set the minimum gap between onsets.
Trait Implementations§
Source§impl Clone for DetectionConfig
impl Clone for DetectionConfig
Source§fn clone(&self) -> DetectionConfig
fn clone(&self) -> DetectionConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 DetectionConfig
impl Debug for DetectionConfig
Auto Trait Implementations§
impl Freeze for DetectionConfig
impl RefUnwindSafe for DetectionConfig
impl Send for DetectionConfig
impl Sync for DetectionConfig
impl Unpin for DetectionConfig
impl UnsafeUnpin for DetectionConfig
impl UnwindSafe for DetectionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().