From 2350e7b6b61fcf7cfda7bd77a7795a0ea40eb5af Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 16 Apr 2024 21:34:26 +0200 Subject: [PATCH] Work on tts --- src/ui/Forms/Tts/TextToSpeech.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 23ee5cdd5..1d31f52af 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -690,7 +690,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts { WorkingDirectory = Path.GetDirectoryName(files[0]), FileName = pythonExe, - Arguments = $"do_tts.py --output_path \"{_waveFolder}\" --preset ultra_fast --voice {v} --text \"{p.Text.RemoveChar('"')}\"", + Arguments = $"do_tts.py --text \"{p.Text.RemoveChar('"')}\" --output_path \"{_waveFolder.TrimEnd(Path.DirectorySeparatorChar)}\" --preset ultra_fast --voice {v}", UseShellExecute = false, CreateNoWindow = true, } @@ -709,6 +709,11 @@ namespace Nikse.SubtitleEdit.Forms.Tts } var inputFile = Path.Combine(_waveFolder, $"{v}_0_2.wav"); + if (!File.Exists(inputFile)) + { + throw new Exception("No file generated by Tortoise TTS?" + Environment.NewLine + inputFile + " not found!"); + } + File.Move(inputFile, outputFileName); progressBar1.Refresh();