successfully confirmed audio is k with sox -r 16000 -t f32 /tmp/transcribed.pcm --default-device

master
Bel LaPointe 2023-11-28 21:30:24 -07:00
parent 4ef419e6c0
commit b4c9ecb98b
1 changed files with 1 additions and 0 deletions

View File

@ -69,6 +69,7 @@ fn main() {
data.iter() data.iter()
.map(|x| *x) .map(|x| *x)
.step_by(channels.into()) .step_by(channels.into())
.step_by((cfg.sample_rate().0 / 16000) as usize)
.for_each(|x| buffer.push(x)); .for_each(|x| buffer.push(x));
if Instant::now() - last > five_seconds { if Instant::now() - last > five_seconds {
let result = w.transcribe(&buffer).unwrap(); let result = w.transcribe(&buffer).unwrap();