Work on tts

This commit is contained in:
Nikolaj Olsson 2024-04-16 21:34:26 +02:00
parent 5b5d306bbd
commit 2350e7b6b6

View File

@ -690,7 +690,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts
{ {
WorkingDirectory = Path.GetDirectoryName(files[0]), WorkingDirectory = Path.GetDirectoryName(files[0]),
FileName = pythonExe, 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, UseShellExecute = false,
CreateNoWindow = true, CreateNoWindow = true,
} }
@ -709,6 +709,11 @@ namespace Nikse.SubtitleEdit.Forms.Tts
} }
var inputFile = Path.Combine(_waveFolder, $"{v}_0_2.wav"); 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); File.Move(inputFile, outputFileName);
progressBar1.Refresh(); progressBar1.Refresh();