mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 12:21:37 +00:00
Normalize transcribed text by replacing line breaks and spaces
This commit is contained in:
parent
188cb3197b
commit
96f316ac26
@ -249,6 +249,12 @@ public partial class VoiceRecorder : MSGComponentBase
|
|||||||
await this.MessageBus.SendWarning(new(Icons.Material.Filled.VoiceChat, this.T("The transcription result is empty.")));
|
await this.MessageBus.SendWarning(new(Icons.Material.Filled.VoiceChat, this.T("The transcription result is empty.")));
|
||||||
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);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user