Trait beat_detector::Strategy [−][src]
Common abstraction over a beat detection strategy. Each strategy keeps ongoing audio samples, for example from microphone. Strategies should have an internal mutable state via interior mutability to compare sample windows (and analysis) against previous values.
Required methods
fn is_beat(&self, samples: &[i16]) -> Option<BeatInfo>
[src]
Checks if inside the samples window a new beat was recognized.
If so, it returns Some
with BeatInfo
as payload.
Implementations may buffer previous samples and combine them with the latest, i.e. make a sliding window.