use pitch_detection::{AutocorrelationDetector, McLeodDetector};
const SAMPLE_RATE : usize = 44100;
const SIZE : usize = 1024;
const PADDING : usize = SIZE / 2;
const POWER_THRESHOLD : f64 = 5.0;
const CLARITY_THRESHOLD : f64 = 0.7;
let signal = vec![0.0; SIZE];
let mut detector = McLeodDetector::new(SIZE, PADDING);
let pitch = detector.get_pitch(&signal, SAMPLE_RATE, POWER_THRESHOLD, CLARITY_THRESHOLD).unwrap();
println!("Frequency: {}, Clarity: {}", pitch.frequency, pitch.clarity);
forked from alesgenova/pitch-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
blaze33/pitch-detection
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
A collection of algorithms to determine the pitch of a sound sample.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Rust 100.0%