From e4b8a89f25b1dd2a6ab7a29471e88522c0b08148 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 17 Jun 2025 07:34:13 +0300 Subject: Fix: remove extra whitespaces from stt transcription --- extra/stt.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extra') diff --git a/extra/stt.go b/extra/stt.go index cd9e82e..ce107b4 100644 --- a/extra/stt.go +++ b/extra/stt.go @@ -103,7 +103,8 @@ func (stt *WhisperSTT) StopRecording() (string, error) { } resptext := strings.TrimRight(string(responseTextBytes), "\n") // in case there are special tokens like [_BEG_] - return specialRE.ReplaceAllString(resptext, ""), nil + resptext = specialRE.ReplaceAllString(resptext, "") + return strings.TrimSpace(strings.ReplaceAll(resptext, "\n ", "\n")), nil } func (stt *WhisperSTT) writeWavHeader(w io.Writer, dataSize int) { -- cgit v1.2.3