From 28f3950bd58351d79dfbad159f9af7f6367fc107 Mon Sep 17 00:00:00 2001 From: AkiyukiOkayasu Date: Wed, 21 Aug 2024 15:20:42 +0900 Subject: [PATCH] Add test case --- tests/integration_test.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 0c4a612..4339dc6 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -3067,6 +3067,20 @@ fn wav_float32_specs() { assert_eq!(spec.num_samples, 240000); } +/// https://archive.org/details/MLKDream +#[test] +fn mlk_dream() { + let wav = include_bytes!("./resources/MLKDream.wav"); + let reader = PcmReaderBuilder::new(wav).build().unwrap(); + let spec = reader.get_pcm_specs(); + // Assertions + assert_eq!(spec.bit_depth, 16); + assert_eq!(spec.audio_format, AudioFormat::LinearPcmLe); // Little endian + assert_eq!(spec.num_channels, 1); + assert_eq!(spec.sample_rate, 22050); + assert_eq!(spec.num_samples, 21_772_800); +} + #[test] fn aiff_float32_specs() { let data = include_bytes!("./resources/Sine440Hz_1ch_48000Hz_32FP.aif");