Beat Detector - Audio Beat Detection Library Written In Rust
This is a Rust library that enables beat detection on live audio data input. One use case is that you have an audio/aux-splitter on your computer where one end goes into the sound system whereas the other goes into the microphone input of a Raspberry Pi.
The crate provides multiple strategies that you can connect to the audio source. So far it offers two strategies:
- Simple Lowpass Filter
- not really good, must be more fine-tuned
- Simple Spectrum Analysis
- good enough for most "simple" songs, like 90s pop hits or "Kids" by "MGMT"
- Super Awesome Analysis (TODO) - CODE CONTRIBUTIONS ARE WELCOME
I'm not an expert in audio analysis, but I'm proud what I achieved so far with the spectrum strategy. This library needs a more "bulletproof" strategy, to cope with complex and fast songs.
Here's a demo I recorded in my room. Of course, it was synced to music, when I recorded it. :)
How To Use
Cargo.toml
= "<latest version>"
code.rs
(also see examples/
in repository!)
//! Minimum example on how to use this library. Sets up the "callback loop".
use Device;
use StrategyKind;
use ;
use Arc;
/// Minimum example on how to use this library. Sets up the "callback loop".