Increase PCM buffer capacity from 8 to 256 to prevent encoding glitches

The small buffer (8) was causing the pump to block frequently when the FLAC
encoder was slow to consume data. This created micro-pauses in the PCM stream
that resulted in audible clicks in the encoded FLAC files.

With a larger buffer (256), the pump can continue sending data without blocking,
ensuring continuous audio flow to the encoder and eliminating the clicks.
This commit is contained in:
Claude
2025-11-08 20:02:04 +00:00
parent f1224516e0
commit 25eb705f59

View File

@@ -435,7 +435,7 @@ impl FlacCacheSink {
encoder_options: EncoderOptions,
collection: Option<String>,
) -> Self {
let logic = FlacCacheSinkLogic::new(cache, covers, collection, encoder_options, 8);
let logic = FlacCacheSinkLogic::new(cache, covers, collection, encoder_options, 256);
Self {
inner: Node::new_with_input(logic, channel_size),
}