Skip to content

ZerNico/dywapitchtrack_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crates.io

dywapitchtrack

Usage

use dywapitchtrack::DywaPitchTracker;

fn main() {
    const SAMPLE_RATE: usize = 44100;
    const SIZE: usize = 1024;

    let dt = 1.0 / SAMPLE_RATE as f32;
    let freq = 300.0;

    // Sound samples
    let samples: Vec<f32> = (0..SIZE)
        .map(|x| (2.0 * std::f32::consts::PI * x as f32 * dt * freq).sin())
        .collect();

    let mut pitch_tracker = DywaPitchTracker::new();
    let pitch = pitch_tracker.compute_pitch(&samples, 0, SIZE)

    println!("Frequency: {}", pitch);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages