1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! # BPM Analyzer
//!
//! A real-time BPM (beats per minute) detection library that analyzes audio input
//! using wavelet decomposition and autocorrelation techniques.
//!
//! ## Features
//!
//! - Real-time audio capture from system audio devices
//! - Wavelet-based onset detection using Discrete Wavelet Transform (DWT)
//! - Multi-band envelope analysis
//! - Autocorrelation-based tempo estimation
//! - Configurable BPM range and analysis parameters
//!
//! ## Example
//!
//! ```no_run
//! use bpm_analyzer::{AnalyzerConfig, begin};
//!
//! // Configure the analyzer with default settings
//! let config = AnalyzerConfig::builder()
//! .min_bpm(60.0)
//! .max_bpm(180.0)
//! .build();
//!
//! // Start the analyzer and receive BPM candidates
//! let bpm_receiver = begin(config).expect("Failed to start analyzer");
//!
//! // Process BPM candidates
//! for detection in bpm_receiver.iter() {
//! if let Some(bpm) = detection.bpm() {
//! println!("Detected BPM: {:.1}", bpm);
//! }
//! }
//! ```
// Module declarations
// Re-exports for public API
pub use ;
pub use AnalyzerConfig;
pub use Receiver;
pub use ;
pub use ;
pub use ;