diff --git a/src/ui/Forms/Tts/RegenerateAudioClip.cs b/src/ui/Forms/Tts/RegenerateAudioClip.cs index 8c31f1ed4..df4ce9f87 100644 --- a/src/ui/Forms/Tts/RegenerateAudioClip.cs +++ b/src/ui/Forms/Tts/RegenerateAudioClip.cs @@ -56,6 +56,8 @@ namespace Nikse.SubtitleEdit.Forms.Tts private void buttonReGenerate_Click(object sender, EventArgs e) { + _libMpv?.Stop(); + Configuration.Settings.Tools.TextToSpeechElevenLabsStability = (double)nikseUpDownStability.Value / 100.0; Configuration.Settings.Tools.TextToSpeechElevenLabsSimilarity = (double)nikseUpDownSimilarity.Value / 100.0; @@ -86,21 +88,26 @@ namespace Nikse.SubtitleEdit.Forms.Tts private void buttonCancel_Click(object sender, EventArgs e) { + _libMpv?.Stop(); DialogResult = DialogResult.Cancel; } private void buttonOK_Click(object sender, EventArgs e) { + _libMpv?.Stop(); DialogResult = DialogResult.OK; } private void buttonPlay_Click(object sender, EventArgs e) { + _libMpv?.Stop(); + if (FileNameAndSpeedFactor == null) { return; } + buttonPlay.Enabled = false; var waveFileName = FileNameAndSpeedFactor.Filename; if (_libMpv != null) @@ -133,6 +140,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts using (var soundPlayer = new System.Media.SoundPlayer(waveFileName)) { soundPlayer.PlaySync(); + buttonPlay.Enabled = true; } } } diff --git a/src/ui/Forms/Tts/ReviewAudioClips.cs b/src/ui/Forms/Tts/ReviewAudioClips.cs index 556b9409e..d6134b347 100644 --- a/src/ui/Forms/Tts/ReviewAudioClips.cs +++ b/src/ui/Forms/Tts/ReviewAudioClips.cs @@ -206,6 +206,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts return; } + _libMpv?.Stop(); buttonPlay.Enabled = false; _playing = true; _abortPlay = false; @@ -265,6 +266,8 @@ namespace Nikse.SubtitleEdit.Forms.Tts return; } + buttonStop_Click(null, null); + var idx = listViewAudioClips.SelectedItems[0].Index; using (var form = new RegenerateAudioClip(_textToSpeech, _subtitle, idx, _engine)) {