From ba58543a9c5aa8f1076810297af4d30a70ab2619 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Fri, 8 Nov 2024 08:46:39 +0100 Subject: [PATCH] Fix two bug inTTS regenerate - thx cvrle77 :) Work on #8981 --- src/ui/Forms/Tts/RegenerateAudioClip.cs | 2 ++ src/ui/Forms/Tts/ReviewAudioClips.cs | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ui/Forms/Tts/RegenerateAudioClip.cs b/src/ui/Forms/Tts/RegenerateAudioClip.cs index 4013166b0..376c0049b 100644 --- a/src/ui/Forms/Tts/RegenerateAudioClip.cs +++ b/src/ui/Forms/Tts/RegenerateAudioClip.cs @@ -120,6 +120,8 @@ namespace Nikse.SubtitleEdit.Forms.Tts private void buttonOK_Click(object sender, EventArgs e) { + _subtitle.Paragraphs[_index].Text = TextBoxReGenerate.Text.Trim(); + _libMpv?.Stop(); DialogResult = DialogResult.OK; } diff --git a/src/ui/Forms/Tts/ReviewAudioClips.cs b/src/ui/Forms/Tts/ReviewAudioClips.cs index d6134b347..4d8b3d5df 100644 --- a/src/ui/Forms/Tts/ReviewAudioClips.cs +++ b/src/ui/Forms/Tts/ReviewAudioClips.cs @@ -272,12 +272,18 @@ namespace Nikse.SubtitleEdit.Forms.Tts using (var form = new RegenerateAudioClip(_textToSpeech, _subtitle, idx, _engine)) { var dr = form.ShowDialog(this); - if (dr == DialogResult.OK) + if (dr != DialogResult.OK) + { + return; + } + + listViewAudioClips.Items[idx].SubItems[5].Text = _subtitle.Paragraphs[idx].Text; + + if (form.FileNameAndSpeedFactor != null) { _fileNames[idx].Filename = form.FileNameAndSpeedFactor.Filename; _fileNames[idx].Factor = form.FileNameAndSpeedFactor.Factor; listViewAudioClips.Items[idx].SubItems[4].Text = $"{(form.FileNameAndSpeedFactor.Factor * 100.0m):0.#}%"; - listViewAudioClips.Items[idx].SubItems[5].Text = _subtitle.Paragraphs[idx].Text; } } }