Normalize transcribed text by replacing line breaks and spaces

This commit is contained in:
Thorsten Sommer 2026-01-11 13:53:34 +01:00
parent 188cb3197b
commit 96f316ac26
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -250,6 +250,12 @@ public partial class VoiceRecorder : MSGComponentBase
return; return;
} }
// Replace line breaks with spaces:
transcribedText = transcribedText.Replace("\r", " ").Replace("\n", " ");
// Replace two spaces with a single space:
transcribedText = transcribedText.Replace(" ", " ");
this.Logger.LogInformation("Transcription completed successfully. Result length: {Length} characters.", transcribedText.Length); this.Logger.LogInformation("Transcription completed successfully. Result length: {Length} characters.", transcribedText.Length);
// Play the transcription done sound effect: // Play the transcription done sound effect: