From 6654d9aa72a48a010a06254e59adb46284acff18 Mon Sep 17 00:00:00 2001 From: Simon Benezan Date: Mon, 29 Apr 2024 03:31:02 +0200 Subject: [PATCH] buffer with 128kb instead of 32kb --- crunchy-cli-core/src/utils/sync.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crunchy-cli-core/src/utils/sync.rs b/crunchy-cli-core/src/utils/sync.rs index 7535645..1e9bc42 100644 --- a/crunchy-cli-core/src/utils/sync.rs +++ b/crunchy-cli-core/src/utils/sync.rs @@ -261,14 +261,14 @@ fn generate_chromaprint( // the stdout is read in chunks because keeping all the raw audio data in memory would take up // a significant amount of space let mut stdout = handle.stdout.take().unwrap(); - let mut buf: [u8; 32_000] = [0; 32_000]; + let mut buf: [u8; 128_000] = [0; 128_000]; while handle.try_wait()?.is_none() { loop { let read_bytes = stdout.read(&mut buf)?; if read_bytes == 0 { break; } - let data: [i16; 16_000] = unsafe { mem::transmute(buf) }; + let data: [i16; 64_000] = unsafe { mem::transmute(buf) }; printer.consume(&data[0..(read_bytes / 2)]) } }