Audio to text: Select model after download + fix tab stops

This commit is contained in:
niksedk 2022-08-27 16:54:40 +02:00
parent ff03ad42e5
commit 00811a6169
6 changed files with 45 additions and 31 deletions

View File

@ -63,7 +63,7 @@
this.buttonCancel.Location = new System.Drawing.Point(622, 427); this.buttonCancel.Location = new System.Drawing.Point(622, 427);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 8; this.buttonCancel.TabIndex = 10;
this.buttonCancel.Text = "C&ancel"; this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
@ -75,7 +75,7 @@
this.buttonGenerate.Location = new System.Drawing.Point(373, 427); this.buttonGenerate.Location = new System.Drawing.Point(373, 427);
this.buttonGenerate.Name = "buttonGenerate"; this.buttonGenerate.Name = "buttonGenerate";
this.buttonGenerate.Size = new System.Drawing.Size(125, 23); this.buttonGenerate.Size = new System.Drawing.Size(125, 23);
this.buttonGenerate.TabIndex = 6; this.buttonGenerate.TabIndex = 8;
this.buttonGenerate.Text = "&Generate"; this.buttonGenerate.Text = "&Generate";
this.buttonGenerate.UseVisualStyleBackColor = true; this.buttonGenerate.UseVisualStyleBackColor = true;
this.buttonGenerate.Click += new System.EventHandler(this.ButtonGenerate_Click); this.buttonGenerate.Click += new System.EventHandler(this.ButtonGenerate_Click);
@ -87,7 +87,7 @@
this.progressBar1.Location = new System.Drawing.Point(12, 427); this.progressBar1.Location = new System.Drawing.Point(12, 427);
this.progressBar1.Name = "progressBar1"; this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(355, 12); this.progressBar1.Size = new System.Drawing.Size(355, 12);
this.progressBar1.TabIndex = 5; this.progressBar1.TabIndex = 7;
this.progressBar1.Visible = false; this.progressBar1.Visible = false;
// //
// labelProgress // labelProgress
@ -97,7 +97,7 @@
this.labelProgress.Location = new System.Drawing.Point(12, 409); this.labelProgress.Location = new System.Drawing.Point(12, 409);
this.labelProgress.Name = "labelProgress"; this.labelProgress.Name = "labelProgress";
this.labelProgress.Size = new System.Drawing.Size(70, 13); this.labelProgress.Size = new System.Drawing.Size(70, 13);
this.labelProgress.TabIndex = 4; this.labelProgress.TabIndex = 6;
this.labelProgress.Text = "labelProgress"; this.labelProgress.Text = "labelProgress";
// //
// textBoxLog // textBoxLog
@ -153,7 +153,7 @@
this.linkLabelOpenModelsFolder.Location = new System.Drawing.Point(301, 51); this.linkLabelOpenModelsFolder.Location = new System.Drawing.Point(301, 51);
this.linkLabelOpenModelsFolder.Name = "linkLabelOpenModelsFolder"; this.linkLabelOpenModelsFolder.Name = "linkLabelOpenModelsFolder";
this.linkLabelOpenModelsFolder.Size = new System.Drawing.Size(98, 13); this.linkLabelOpenModelsFolder.Size = new System.Drawing.Size(98, 13);
this.linkLabelOpenModelsFolder.TabIndex = 0; this.linkLabelOpenModelsFolder.TabIndex = 3;
this.linkLabelOpenModelsFolder.TabStop = true; this.linkLabelOpenModelsFolder.TabStop = true;
this.linkLabelOpenModelsFolder.Text = "Open models folder"; this.linkLabelOpenModelsFolder.Text = "Open models folder";
this.linkLabelOpenModelsFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelOpenModelFolder_LinkClicked); this.linkLabelOpenModelsFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelOpenModelFolder_LinkClicked);
@ -220,7 +220,7 @@
this.buttonBatchMode.Location = new System.Drawing.Point(504, 427); this.buttonBatchMode.Location = new System.Drawing.Point(504, 427);
this.buttonBatchMode.Name = "buttonBatchMode"; this.buttonBatchMode.Name = "buttonBatchMode";
this.buttonBatchMode.Size = new System.Drawing.Size(112, 23); this.buttonBatchMode.Size = new System.Drawing.Size(112, 23);
this.buttonBatchMode.TabIndex = 7; this.buttonBatchMode.TabIndex = 9;
this.buttonBatchMode.Text = "Batch mode"; this.buttonBatchMode.Text = "Batch mode";
this.buttonBatchMode.UseVisualStyleBackColor = true; this.buttonBatchMode.UseVisualStyleBackColor = true;
this.buttonBatchMode.Click += new System.EventHandler(this.buttonBatchMode_Click); this.buttonBatchMode.Click += new System.EventHandler(this.buttonBatchMode_Click);

View File

@ -64,7 +64,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing; checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing;
_voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk"); _voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk");
FillModels(); FillModels(string.Empty);
textBoxLog.Visible = false; textBoxLog.Visible = false;
textBoxLog.Dock = DockStyle.Fill; textBoxLog.Dock = DockStyle.Fill;
@ -85,8 +85,9 @@ namespace Nikse.SubtitleEdit.Forms
listViewInputFiles.Visible = false; listViewInputFiles.Visible = false;
} }
private void FillModels() private void FillModels(string lastDownloadedModel)
{ {
var selectName = string.IsNullOrEmpty(lastDownloadedModel) ? Configuration.Settings.Tools.VoskModel : lastDownloadedModel;
comboBoxModels.Items.Clear(); comboBoxModels.Items.Clear();
foreach (var directory in Directory.GetDirectories(_voskFolder)) foreach (var directory in Directory.GetDirectories(_voskFolder))
{ {
@ -97,7 +98,7 @@ namespace Nikse.SubtitleEdit.Forms
} }
comboBoxModels.Items.Add(name); comboBoxModels.Items.Add(name);
if (name == Configuration.Settings.Tools.VoskModel) if (name == selectName)
{ {
comboBoxModels.SelectedIndex = comboBoxModels.Items.Count - 1; comboBoxModels.SelectedIndex = comboBoxModels.Items.Count - 1;
} }
@ -140,6 +141,7 @@ namespace Nikse.SubtitleEdit.Forms
buttonGenerate.Enabled = false; buttonGenerate.Enabled = false;
buttonDownload.Enabled = false; buttonDownload.Enabled = false;
buttonBatchMode.Enabled = false; buttonBatchMode.Enabled = false;
comboBoxModels.Enabled = false;
var waveFileName = GenerateWavFile(_videoFileName, _audioTrackNumber); var waveFileName = GenerateWavFile(_videoFileName, _audioTrackNumber);
textBoxLog.AppendText("Wav file name: " + waveFileName); textBoxLog.AppendText("Wav file name: " + waveFileName);
textBoxLog.AppendText(Environment.NewLine); textBoxLog.AppendText(Environment.NewLine);
@ -570,10 +572,10 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonDownload_Click(object sender, EventArgs e) private void buttonDownload_Click(object sender, EventArgs e)
{ {
using (var form = new AudioToTextModelDownload() { AutoClose = true }) using (var form = new AudioToTextModelDownload { AutoClose = true })
{ {
form.ShowDialog(this); form.ShowDialog(this);
FillModels(); FillModels(form.LastDownloadedModel);
} }
} }
@ -620,12 +622,14 @@ namespace Nikse.SubtitleEdit.Forms
{ {
if (_batchMode) if (_batchMode)
{ {
groupBoxInputFiles.Enabled = true;
Height = checkBoxUsePostProcessing.Bottom + progressBar1.Height + buttonCancel.Height + 450; Height = checkBoxUsePostProcessing.Bottom + progressBar1.Height + buttonCancel.Height + 450;
listViewInputFiles.Visible = true; listViewInputFiles.Visible = true;
buttonBatchMode.Text = LanguageSettings.Current.Split.Basic; buttonBatchMode.Text = LanguageSettings.Current.Split.Basic;
} }
else else
{ {
groupBoxInputFiles.Enabled = false;
Height = checkBoxUsePostProcessing.Bottom + progressBar1.Height + buttonCancel.Height + 70; Height = checkBoxUsePostProcessing.Bottom + progressBar1.Height + buttonCancel.Height + 70;
listViewInputFiles.Visible = false; listViewInputFiles.Visible = false;
buttonBatchMode.Text = LanguageSettings.Current.AudioToText.BatchMode; buttonBatchMode.Text = LanguageSettings.Current.AudioToText.BatchMode;

View File

@ -42,7 +42,7 @@
this.labelPleaseWait.Location = new System.Drawing.Point(12, 92); this.labelPleaseWait.Location = new System.Drawing.Point(12, 92);
this.labelPleaseWait.Name = "labelPleaseWait"; this.labelPleaseWait.Name = "labelPleaseWait";
this.labelPleaseWait.Size = new System.Drawing.Size(70, 13); this.labelPleaseWait.Size = new System.Drawing.Size(70, 13);
this.labelPleaseWait.TabIndex = 2; this.labelPleaseWait.TabIndex = 3;
this.labelPleaseWait.Text = "Please wait..."; this.labelPleaseWait.Text = "Please wait...";
// //
// buttonDownload // buttonDownload
@ -64,7 +64,7 @@
this.buttonCancel.Location = new System.Drawing.Point(328, 87); this.buttonCancel.Location = new System.Drawing.Point(328, 87);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 3; this.buttonCancel.TabIndex = 4;
this.buttonCancel.Text = "Cancel"; this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
@ -88,7 +88,7 @@
this.textBoxError.Name = "textBoxError"; this.textBoxError.Name = "textBoxError";
this.textBoxError.ReadOnly = true; this.textBoxError.ReadOnly = true;
this.textBoxError.Size = new System.Drawing.Size(388, 12); this.textBoxError.Size = new System.Drawing.Size(388, 12);
this.textBoxError.TabIndex = 19; this.textBoxError.TabIndex = 2;
// //
// AudioToTextModelDownload // AudioToTextModelDownload
// //

View File

@ -12,6 +12,7 @@ namespace Nikse.SubtitleEdit.Forms
public sealed partial class AudioToTextModelDownload : Form public sealed partial class AudioToTextModelDownload : Form
{ {
public bool AutoClose { get; internal set; } public bool AutoClose { get; internal set; }
public string LastDownloadedModel { get; internal set; }
private readonly CancellationTokenSource _cancellationTokenSource; private readonly CancellationTokenSource _cancellationTokenSource;
public AudioToTextModelDownload() public AudioToTextModelDownload()
@ -123,6 +124,11 @@ namespace Nikse.SubtitleEdit.Forms
var dir = zip.ReadCentralDir(); var dir = zip.ReadCentralDir();
foreach (var entry in dir) foreach (var entry in dir)
{ {
if (LastDownloadedModel == null)
{
LastDownloadedModel = Path.GetDirectoryName(entry.FilenameInZip);
}
var path = Path.Combine(folder, entry.FilenameInZip); var path = Path.Combine(folder, entry.FilenameInZip);
zip.ExtractFile(entry, path); zip.ExtractFile(entry, path);
} }
@ -131,6 +137,8 @@ namespace Nikse.SubtitleEdit.Forms
Cursor = Cursors.Default; Cursor = Cursors.Default;
labelPleaseWait.Text = string.Empty; labelPleaseWait.Text = string.Empty;
if (AutoClose) if (AutoClose)
{ {
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;

View File

@ -59,7 +59,7 @@
this.buttonCancel.Location = new System.Drawing.Point(622, 427); this.buttonCancel.Location = new System.Drawing.Point(622, 427);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 8; this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "C&ancel"; this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
@ -68,10 +68,10 @@
// //
this.buttonGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonGenerate.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.buttonGenerate.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonGenerate.Location = new System.Drawing.Point(373, 427); this.buttonGenerate.Location = new System.Drawing.Point(491, 427);
this.buttonGenerate.Name = "buttonGenerate"; this.buttonGenerate.Name = "buttonGenerate";
this.buttonGenerate.Size = new System.Drawing.Size(125, 23); this.buttonGenerate.Size = new System.Drawing.Size(125, 23);
this.buttonGenerate.TabIndex = 6; this.buttonGenerate.TabIndex = 5;
this.buttonGenerate.Text = "&Generate"; this.buttonGenerate.Text = "&Generate";
this.buttonGenerate.UseVisualStyleBackColor = true; this.buttonGenerate.UseVisualStyleBackColor = true;
this.buttonGenerate.Click += new System.EventHandler(this.ButtonGenerate_Click); this.buttonGenerate.Click += new System.EventHandler(this.ButtonGenerate_Click);
@ -82,8 +82,8 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.progressBar1.Location = new System.Drawing.Point(12, 427); this.progressBar1.Location = new System.Drawing.Point(12, 427);
this.progressBar1.Name = "progressBar1"; this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(355, 12); this.progressBar1.Size = new System.Drawing.Size(473, 12);
this.progressBar1.TabIndex = 5; this.progressBar1.TabIndex = 4;
this.progressBar1.Visible = false; this.progressBar1.Visible = false;
// //
// labelProgress // labelProgress
@ -128,7 +128,7 @@
this.groupBoxModels.Location = new System.Drawing.Point(15, 66); this.groupBoxModels.Location = new System.Drawing.Point(15, 66);
this.groupBoxModels.Name = "groupBoxModels"; this.groupBoxModels.Name = "groupBoxModels";
this.groupBoxModels.Size = new System.Drawing.Size(682, 82); this.groupBoxModels.Size = new System.Drawing.Size(682, 82);
this.groupBoxModels.TabIndex = 3; this.groupBoxModels.TabIndex = 1;
this.groupBoxModels.TabStop = false; this.groupBoxModels.TabStop = false;
this.groupBoxModels.Text = "Models"; this.groupBoxModels.Text = "Models";
// //
@ -138,7 +138,7 @@
this.buttonDownload.Location = new System.Drawing.Point(265, 43); this.buttonDownload.Location = new System.Drawing.Point(265, 43);
this.buttonDownload.Name = "buttonDownload"; this.buttonDownload.Name = "buttonDownload";
this.buttonDownload.Size = new System.Drawing.Size(28, 23); this.buttonDownload.Size = new System.Drawing.Size(28, 23);
this.buttonDownload.TabIndex = 2; this.buttonDownload.TabIndex = 1;
this.buttonDownload.Text = "..."; this.buttonDownload.Text = "...";
this.buttonDownload.UseVisualStyleBackColor = true; this.buttonDownload.UseVisualStyleBackColor = true;
this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click); this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click);
@ -149,7 +149,7 @@
this.linkLabelOpenModelsFolder.Location = new System.Drawing.Point(301, 51); this.linkLabelOpenModelsFolder.Location = new System.Drawing.Point(301, 51);
this.linkLabelOpenModelsFolder.Name = "linkLabelOpenModelsFolder"; this.linkLabelOpenModelsFolder.Name = "linkLabelOpenModelsFolder";
this.linkLabelOpenModelsFolder.Size = new System.Drawing.Size(98, 13); this.linkLabelOpenModelsFolder.Size = new System.Drawing.Size(98, 13);
this.linkLabelOpenModelsFolder.TabIndex = 0; this.linkLabelOpenModelsFolder.TabIndex = 2;
this.linkLabelOpenModelsFolder.TabStop = true; this.linkLabelOpenModelsFolder.TabStop = true;
this.linkLabelOpenModelsFolder.Text = "Open models folder"; this.linkLabelOpenModelsFolder.Text = "Open models folder";
this.linkLabelOpenModelsFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelOpenModelFolder_LinkClicked); this.linkLabelOpenModelsFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelOpenModelFolder_LinkClicked);
@ -170,7 +170,7 @@
this.comboBoxModels.Location = new System.Drawing.Point(19, 45); this.comboBoxModels.Location = new System.Drawing.Point(19, 45);
this.comboBoxModels.Name = "comboBoxModels"; this.comboBoxModels.Name = "comboBoxModels";
this.comboBoxModels.Size = new System.Drawing.Size(240, 21); this.comboBoxModels.Size = new System.Drawing.Size(240, 21);
this.comboBoxModels.TabIndex = 1; this.comboBoxModels.TabIndex = 0;
this.comboBoxModels.SelectedIndexChanged += new System.EventHandler(this.comboBoxModels_SelectedIndexChanged); this.comboBoxModels.SelectedIndexChanged += new System.EventHandler(this.comboBoxModels_SelectedIndexChanged);
// //
// linkLabelVoskWebSite // linkLabelVoskWebSite
@ -179,7 +179,7 @@
this.linkLabelVoskWebSite.Location = new System.Drawing.Point(12, 26); this.linkLabelVoskWebSite.Location = new System.Drawing.Point(12, 26);
this.linkLabelVoskWebSite.Name = "linkLabelVoskWebSite"; this.linkLabelVoskWebSite.Name = "linkLabelVoskWebSite";
this.linkLabelVoskWebSite.Size = new System.Drawing.Size(70, 13); this.linkLabelVoskWebSite.Size = new System.Drawing.Size(70, 13);
this.linkLabelVoskWebSite.TabIndex = 2; this.linkLabelVoskWebSite.TabIndex = 0;
this.linkLabelVoskWebSite.TabStop = true; this.linkLabelVoskWebSite.TabStop = true;
this.linkLabelVoskWebSite.Text = "Vosk website"; this.linkLabelVoskWebSite.Text = "Vosk website";
this.linkLabelVoskWebSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelVoskWebsite_LinkClicked); this.linkLabelVoskWebSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelVoskWebsite_LinkClicked);
@ -205,7 +205,7 @@
this.checkBoxUsePostProcessing.Location = new System.Drawing.Point(15, 162); this.checkBoxUsePostProcessing.Location = new System.Drawing.Point(15, 162);
this.checkBoxUsePostProcessing.Name = "checkBoxUsePostProcessing"; this.checkBoxUsePostProcessing.Name = "checkBoxUsePostProcessing";
this.checkBoxUsePostProcessing.Size = new System.Drawing.Size(312, 17); this.checkBoxUsePostProcessing.Size = new System.Drawing.Size(312, 17);
this.checkBoxUsePostProcessing.TabIndex = 4; this.checkBoxUsePostProcessing.TabIndex = 2;
this.checkBoxUsePostProcessing.Text = "Use post-processing (line merge, fix casing, and punctuation)"; this.checkBoxUsePostProcessing.Text = "Use post-processing (line merge, fix casing, and punctuation)";
this.checkBoxUsePostProcessing.UseVisualStyleBackColor = true; this.checkBoxUsePostProcessing.UseVisualStyleBackColor = true;
// //
@ -218,7 +218,7 @@
this.groupBoxInputFiles.Location = new System.Drawing.Point(15, 200); this.groupBoxInputFiles.Location = new System.Drawing.Point(15, 200);
this.groupBoxInputFiles.Name = "groupBoxInputFiles"; this.groupBoxInputFiles.Name = "groupBoxInputFiles";
this.groupBoxInputFiles.Size = new System.Drawing.Size(682, 185); this.groupBoxInputFiles.Size = new System.Drawing.Size(682, 185);
this.groupBoxInputFiles.TabIndex = 5; this.groupBoxInputFiles.TabIndex = 3;
this.groupBoxInputFiles.TabStop = false; this.groupBoxInputFiles.TabStop = false;
this.groupBoxInputFiles.Text = "Input files"; this.groupBoxInputFiles.Text = "Input files";
// //

View File

@ -49,7 +49,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing; checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing;
_voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk"); _voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk");
FillModels(); FillModels(string.Empty);
textBoxLog.Visible = false; textBoxLog.Visible = false;
textBoxLog.Dock = DockStyle.Fill; textBoxLog.Dock = DockStyle.Fill;
@ -64,8 +64,9 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
private void FillModels() private void FillModels(string lastDownloadedModel)
{ {
var selectName = string.IsNullOrEmpty(lastDownloadedModel) ? Configuration.Settings.Tools.VoskModel : lastDownloadedModel;
comboBoxModels.Items.Clear(); comboBoxModels.Items.Clear();
foreach (var directory in Directory.GetDirectories(_voskFolder)) foreach (var directory in Directory.GetDirectories(_voskFolder))
{ {
@ -76,7 +77,7 @@ namespace Nikse.SubtitleEdit.Forms
} }
comboBoxModels.Items.Add(name); comboBoxModels.Items.Add(name);
if (name == Configuration.Settings.Tools.VoskModel) if (name == selectName)
{ {
comboBoxModels.SelectedIndex = comboBoxModels.Items.Count - 1; comboBoxModels.SelectedIndex = comboBoxModels.Items.Count - 1;
} }
@ -125,6 +126,7 @@ namespace Nikse.SubtitleEdit.Forms
var modelFileName = Path.Combine(_voskFolder, comboBoxModels.Text); var modelFileName = Path.Combine(_voskFolder, comboBoxModels.Text);
buttonGenerate.Enabled = false; buttonGenerate.Enabled = false;
buttonDownload.Enabled = false; buttonDownload.Enabled = false;
comboBoxModels.Enabled = false;
var waveFileName = videoFileName; var waveFileName = videoFileName;
textBoxLog.AppendText("Wav file name: " + waveFileName + Environment.NewLine); textBoxLog.AppendText("Wav file name: " + waveFileName + Environment.NewLine);
var transcript = TranscribeViaVosk(waveFileName, modelFileName); var transcript = TranscribeViaVosk(waveFileName, modelFileName);
@ -382,10 +384,10 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonDownload_Click(object sender, EventArgs e) private void buttonDownload_Click(object sender, EventArgs e)
{ {
using (var form = new AudioToTextModelDownload() { AutoClose = true }) using (var form = new AudioToTextModelDownload { AutoClose = true })
{ {
form.ShowDialog(this); form.ShowDialog(this);
FillModels(); FillModels(form.LastDownloadedModel);
} }
} }