Skip to content

Commit 5253ff2

Browse files
committed
ci: add silent MP3 file and test for decoder silence (#411)
1 parent a2fc272 commit 5253ff2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

assets/silence.mp3

1.42 KB
Binary file not shown.

tests/mp3_test.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[cfg(any(feature = "minimp3", feature = "symphonia-mp3"))]
2+
#[test]
3+
fn test_silent_mp3() {
4+
let file = std::fs::File::open("assets/silence.mp3").unwrap();
5+
let mut decoder = rodio::Decoder::try_from(file).unwrap();
6+
7+
// File is just silence
8+
assert!(decoder.all(|x| x < 0.0001));
9+
}

0 commit comments

Comments
 (0)