Cleanup repo from audio data
This commit is contained in:
parent
1445939bf8
commit
479fbc7b89
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
data/picture.jpg
BIN
data/picture.jpg
Binary file not shown.
Before Width: | Height: | Size: 826 KiB |
BIN
data/picture.png
BIN
data/picture.png
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
BIN
data/white_noise.mp3
Normal file
Binary file not shown.
|
@ -274,7 +274,7 @@ mod tests {
|
||||||
let paths = vec![
|
let paths = vec![
|
||||||
"./data/s16_mono_22_5kHz.flac",
|
"./data/s16_mono_22_5kHz.flac",
|
||||||
"./data/testcue.cue",
|
"./data/testcue.cue",
|
||||||
"./data/white_noise.flac",
|
"./data/white_noise.mp3",
|
||||||
"definitely-not-existing.foo",
|
"definitely-not-existing.foo",
|
||||||
"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_TRACK001"), None),
|
||||||
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK002"), None),
|
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK002"), None),
|
||||||
(true, PathBuf::from("./data/testcue.cue/CUE_TRACK003"), 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);
|
assert_eq!(results, expected_results);
|
||||||
|
|
|
@ -303,13 +303,14 @@ mod tests {
|
||||||
assert!(0.0000001 > (expected - actual).abs());
|
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();
|
let mut spectral_desc = SpectralDesc::new(22050).unwrap();
|
||||||
for chunk in song.sample_array.chunks_exact(SpectralDesc::HOP_SIZE) {
|
for chunk in song.sample_array.chunks_exact(SpectralDesc::HOP_SIZE) {
|
||||||
spectral_desc.do_(&chunk).unwrap();
|
spectral_desc.do_(&chunk).unwrap();
|
||||||
}
|
}
|
||||||
|
println!("{:?}", spectral_desc.get_flatness());
|
||||||
// White noise - as close to 1 as possible
|
// 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
|
for (expected, actual) in expected_values
|
||||||
.iter()
|
.iter()
|
||||||
.zip(spectral_desc.get_flatness().iter())
|
.zip(spectral_desc.get_flatness().iter())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user