summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-06-17 07:34:13 +0300
committerGrail Finder <wohilas@gmail.com>2025-06-17 07:34:13 +0300
commite4b8a89f25b1dd2a6ab7a29471e88522c0b08148 (patch)
treef9c734cd148e29bc09e55af1a24705b6378641bb /extra
parent5a489211ef184a62f5ed81dd8f742f340ec794e9 (diff)
Fix: remove extra whitespaces from stt transcriptionHEADmaster
Diffstat (limited to 'extra')
-rw-r--r--extra/stt.go3
1 files changed, 2 insertions, 1 deletions
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) {