Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

Add a little extra padding to avoid some failures.

CJ Pais4a7f5e12819c
diff --git a/src-tauri/src/managers/audio.rs b/src-tauri/src/managers/audio.rs
index 75bfcf3f..e274d984 100644
--- a/src-tauri/src/managers/audio.rs
+++ b/src-tauri/src/managers/audio.rs
@@ -154,7 +154,7 @@ impl AudioRecordingManager {
} else {
// Pad to minimum 1000ms if needed
if duration_ms < 1000.0 {
- let target_samples = (16000.0 * (1000.0 / 1000.0)) as usize; // 16000 samples for 1 second
+ let target_samples = (16400.0 * (1000.0 / 1000.0)) as usize; // 16000 samples for 1 second
let mut padded_audio = audio_data;
padded_audio.resize(target_samples, 0.0); // Pad with silence (zeros)
Some(padded_audio)