pub struct Onset {
pub sample_index: usize,
pub time_secs: f32,
pub strength: f32,
}Expand description
A detected onset event.
§Examples
use resonant_analysis::onset::Onset;
let o = Onset { sample_index: 22050, time_secs: 0.5, strength: 1.2 };
assert_eq!(o.time_secs, 0.5);Fields§
§sample_index: usizeSample index of the onset.
time_secs: f32Time in seconds.
strength: f32Strength of the onset (spectral flux value).
Trait Implementations§
impl Copy for Onset
Source§impl<'de> Deserialize<'de> for Onset
impl<'de> Deserialize<'de> for Onset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Onset
Auto Trait Implementations§
impl Freeze for Onset
impl RefUnwindSafe for Onset
impl Send for Onset
impl Sync for Onset
impl Unpin for Onset
impl UnsafeUnpin for Onset
impl UnwindSafe for Onset
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