diff --git a/crates/audio/src/write/flac/mod.rs b/crates/audio/src/write/flac/mod.rs index bbe46072..5f25c25c 100644 --- a/crates/audio/src/write/flac/mod.rs +++ b/crates/audio/src/write/flac/mod.rs @@ -75,7 +75,7 @@ impl Writer { }) } - /// The frame count after `frames` more, or an error past what FLAC can count (2^36 frames). + /// The frame count after `frames` more, or an error past what FLAC can count (2^36 - 1 frames). pub(crate) fn check_room(&self, frames: u64) -> Result { let total = self.frames.saturating_add(frames); if total >= 1u64 << 36 { diff --git a/crates/audio/src/write/mod.rs b/crates/audio/src/write/mod.rs index cb75f0d3..13e42ea7 100644 --- a/crates/audio/src/write/mod.rs +++ b/crates/audio/src/write/mod.rs @@ -175,7 +175,7 @@ impl FileEncoder { } /// Fails, without writing anything, when `frames` more frames would not fit the format (an - /// AIFF holds 4 GiB, a FLAC 2^36 frames). + /// AIFF holds 4 GiB, a FLAC 2^36 - 1 frames). pub fn check_room(&self, frames: u64) -> Result<()> { match &self.writer { #[cfg(feature = "pcm-encode")] diff --git a/crates/audio/tests/audio/roundtrip.rs b/crates/audio/tests/audio/roundtrip.rs index a043a631..907a830d 100644 --- a/crates/audio/tests/audio/roundtrip.rs +++ b/crates/audio/tests/audio/roundtrip.rs @@ -73,7 +73,7 @@ fn wav_and_aiff_roundtrip_all_depths_and_layouts() { #[test] fn flac_roundtrip_is_lossless_vs_wav() { for depth in [BitDepth::Int16, BitDepth::Int24, BitDepth::Int32] { - for channels in [1, 2, 6] { + for channels in [1, 2, 3, 4, 5, 6, 7, 8] { // Spans several blocks plus a short final block. let src = sine(44_100, channels, 4096 * 2 + 17); let wav = encode(&src, &EncodeOptions::new(EncodeFormat::Wav).with_bit_depth(depth).with_dither(false)).unwrap();