From 34459f66218f603c9900786fa5c1352cb16321d8 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Tue, 25 Feb 2025 18:55:30 +0545 Subject: [PATCH] Optimize Whisper C++ parameters for better transcription quality --- VoiceInk/LibWhisper.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/VoiceInk/LibWhisper.swift b/VoiceInk/LibWhisper.swift index 4f07c0a..e6ffe0b 100644 --- a/VoiceInk/LibWhisper.swift +++ b/VoiceInk/LibWhisper.swift @@ -76,9 +76,18 @@ actor WhisperContext { params.translate = false params.n_threads = Int32(maxThreads) params.offset_ms = 0 - params.no_context = true + params.no_context = false params.single_segment = false - + + // Additional optimized parameters + params.suppress_blank = true + params.thold_pt = 0.01 + + // Only set audio_ctx if we're not in single_segment mode + if !params.single_segment { + params.audio_ctx = 1500 + } + whisper_reset_timings(context) print("About to run whisper_full") samples.withUnsafeBufferPointer { samples in