Work on tts

This commit is contained in:
Nikolaj Olsson 2024-04-17 16:52:12 +02:00
parent 44da437cc3
commit 32005f0198
2 changed files with 11 additions and 2 deletions

View File

@ -155,6 +155,7 @@
this.TextBoxTest.Size = new System.Drawing.Size(351, 20); this.TextBoxTest.Size = new System.Drawing.Size(351, 20);
this.TextBoxTest.TabIndex = 20; this.TextBoxTest.TabIndex = 20;
this.TextBoxTest.Text = "Hello, how are you?"; this.TextBoxTest.Text = "Hello, how are you?";
this.TextBoxTest.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxTest_KeyDown);
// //
// buttonTestVoice // buttonTestVoice
// //

View File

@ -570,7 +570,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts
var modelFileName = Path.Combine(piperPath, voice.ModelShort); var modelFileName = Path.Combine(piperPath, voice.ModelShort);
if (!File.Exists(modelFileName)) if (!File.Exists(modelFileName))
{ {
using (var form = new PiperDownload("Piper TextToSpeech Voice") { AutoClose = true, ModelUrl = voice.Model, ModelFileName = modelFileName, PiperPath = piperPath }) using (var form = new PiperDownload("Piper TextToSpeech voice: " + voice.Voice) { AutoClose = true, ModelUrl = voice.Model, ModelFileName = modelFileName, PiperPath = piperPath })
{ {
if (form.ShowDialog(this) != DialogResult.OK) if (form.ShowDialog(this) != DialogResult.OK)
{ {
@ -582,7 +582,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts
var configFileName = Path.Combine(piperPath, voice.ConfigShort); var configFileName = Path.Combine(piperPath, voice.ConfigShort);
if (!File.Exists(configFileName)) if (!File.Exists(configFileName))
{ {
using (var form = new PiperDownload("Piper TextToSpeech Voice") { AutoClose = true, ModelUrl = voice.Config, ModelFileName = configFileName, PiperPath = piperPath }) using (var form = new PiperDownload("Piper TextToSpeech voice config: " + voice.Voice) { AutoClose = true, ModelUrl = voice.Config, ModelFileName = configFileName, PiperPath = piperPath })
{ {
if (form.ShowDialog(this) != DialogResult.OK) if (form.ShowDialog(this) != DialogResult.OK)
{ {
@ -1245,5 +1245,13 @@ namespace Nikse.SubtitleEdit.Forms.Tts
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
} }
private void TextBoxTest_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
buttonTestVoice_Click(null, null);
}
}
} }
} }