From c85c3556d97c335bd5f1e27c9c42278215937279 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 22 Apr 2024 19:44:07 +0200 Subject: [PATCH] Improve clean --- src/ui/Forms/Tts/TextToSpeech.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 005e19018..743c6d8ad 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -339,6 +339,14 @@ namespace Nikse.SubtitleEdit.Forms.Tts File.Delete(fileName); } } + + foreach (var fileName in Directory.GetFiles(waveFolder, "*.mp3")) + { + if (!fileName.Equals(resultAudioFile, StringComparison.OrdinalIgnoreCase)) + { + File.Delete(fileName); + } + } } private List FixParagraphAudioSpeed(Subtitle subtitle, string overrideFileName)