Skip to content

Commit

Permalink
Cleanup repo from audio data
Browse files Browse the repository at this point in the history
  • Loading branch information
Polochon-street committed Dec 28, 2023
1 parent 1445939 commit 479fbc7
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 4 deletions.
Binary file removed data/chroma-stft-normalized-expected.npy
Binary file not shown.
Binary file removed data/downsampled.npy
Binary file not shown.
Binary file removed data/estimate-tuning-pitch.npy
Binary file not shown.
Binary file removed data/f_analysis.npy
Binary file not shown.
Binary file removed data/f_analysis_normalized.npy
Binary file not shown.
Binary file removed data/filtered_features.npy
Binary file not shown.
Binary file removed data/picture.jpg
Binary file not shown.
Binary file modified data/picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/sorted_features.npy
Binary file not shown.
Binary file removed data/white_noise.flac
Binary file not shown.
Binary file added data/white_noise.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod tests {
let paths = vec![
"./data/s16_mono_22_5kHz.flac",
"./data/testcue.cue",
"./data/white_noise.flac",
"./data/white_noise.mp3",
"definitely-not-existing.foo",
"not-existing.foo",
];
Expand Down Expand Up @@ -317,7 +317,7 @@ mod tests {
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK001"), None),
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK002"), None),
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK003"), None),
(true, PathBuf::from("./data/white_noise.flac"), None),
(true, PathBuf::from("./data/white_noise.mp3"), None),
];

assert_eq!(results, expected_results);
Expand Down
5 changes: 3 additions & 2 deletions src/timbral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,14 @@ mod tests {
assert!(0.0000001 > (expected - actual).abs());
}

let song = Song::decode(Path::new("data/white_noise.flac")).unwrap();
let song = Song::decode(Path::new("data/white_noise.mp3")).unwrap();
let mut spectral_desc = SpectralDesc::new(22050).unwrap();
for chunk in song.sample_array.chunks_exact(SpectralDesc::HOP_SIZE) {
spectral_desc.do_(&chunk).unwrap();
}
println!("{:?}", spectral_desc.get_flatness());
// White noise - as close to 1 as possible
let expected_values = vec![0.6706717, -0.9685736];
let expected_values = vec![0.5785303, -0.9426308];
for (expected, actual) in expected_values
.iter()
.zip(spectral_desc.get_flatness().iter())
Expand Down

0 comments on commit 479fbc7

Please sign in to comment.