Merge pull request #69 from Polochon-street/cleanup-repo

Cleanup repo from audio data
This commit is contained in:
Polochon-street 2023-12-28 14:08:33 +01:00 committed by GitHub
commit bf35f643fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 5 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Binary file not shown.

BIN
data/white_noise.mp3 Normal file

Binary file not shown.

View File

@ -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",
];
@ -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);

View File

@ -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())