From b4c9ecb98b29430c225e81531292f94f46cb4f84 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 28 Nov 2023 21:30:24 -0700 Subject: [PATCH] successfully confirmed audio is k with sox -r 16000 -t f32 /tmp/transcribed.pcm --default-device --- rust-whisper.d/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust-whisper.d/src/main.rs b/rust-whisper.d/src/main.rs index 1c26795..5a7ece4 100644 --- a/rust-whisper.d/src/main.rs +++ b/rust-whisper.d/src/main.rs @@ -69,6 +69,7 @@ fn main() { data.iter() .map(|x| *x) .step_by(channels.into()) + .step_by((cfg.sample_rate().0 / 16000) as usize) .for_each(|x| buffer.push(x)); if Instant::now() - last > five_seconds { let result = w.transcribe(&buffer).unwrap();