diff options
Diffstat (limited to 'extra')
-rw-r--r-- | extra/stt.go | 3 |
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) { |