diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml
index 03ece231c..c1d25affd 100644
--- a/LanguageBaseEnglish.xml
+++ b/LanguageBaseEnglish.xml
@@ -176,9 +176,13 @@ Note: Do check free disk space.
Audio to text
Generate text from audio via Vosk/Kaldi speech recognition
+ Generate text from audio via Whisper speech recognition
Vosk website
+ Whisper website
Models
+ Languages and models
Choose model
+ Choose model
Open models folder
Loading Vosk speech recognition model...
Transcribing audio to text...
@@ -186,6 +190,7 @@ Note: Do check free disk space.
{0} files saved to video source folder
Use post-processing (line merge, fix casing, punctuation, and more)
Batch mode
+ Keep partial transcription
Advanced Sub Station Alpha attachments
@@ -1265,7 +1270,7 @@ To use an API key, go to "Options -> Settings -> Tools" to enter your Goog
Generate text from video...
Generate blank video...
Generate video with burned-in sub...
- Audio to text...
+ Audio to text ({0})...
Import chapters from video
Generate/import shot changes...
Remove/export shot changes...
diff --git a/src/ui/Forms/SpeechRecognition/AudioToText.Designer.cs b/src/ui/Forms/AudioToText/VoskAudioToText.Designer.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/AudioToText.Designer.cs
rename to src/ui/Forms/AudioToText/VoskAudioToText.Designer.cs
index 5203c0820..c62d36eb2 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToText.Designer.cs
+++ b/src/ui/Forms/AudioToText/VoskAudioToText.Designer.cs
@@ -1,6 +1,6 @@
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- sealed partial class AudioToText
+ sealed partial class VoskAudioToText
{
///
/// Required designer variable.
diff --git a/src/ui/Forms/SpeechRecognition/AudioToText.cs b/src/ui/Forms/AudioToText/VoskAudioToText.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/AudioToText.cs
rename to src/ui/Forms/AudioToText/VoskAudioToText.cs
index 000e4b7d8..d17a31550 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToText.cs
+++ b/src/ui/Forms/AudioToText/VoskAudioToText.cs
@@ -13,9 +13,9 @@ using Nikse.SubtitleEdit.Core.SubtitleFormats;
using Nikse.SubtitleEdit.Logic;
using Vosk;
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- public sealed partial class AudioToText : Form
+ public sealed partial class VoskAudioToText : Form
{
private readonly string _videoFileName;
private readonly int _audioTrackNumber;
@@ -34,7 +34,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
public Subtitle TranscribedSubtitle { get; private set; }
- public AudioToText(string videoFileName, int audioTrackNumber, Form parentForm)
+ public VoskAudioToText(string videoFileName, int audioTrackNumber, Form parentForm)
{
UiUtil.PreInitialize(this);
InitializeComponent();
@@ -611,7 +611,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
private void buttonDownload_Click(object sender, EventArgs e)
{
- using (var form = new AudioToTextModelDownload { AutoClose = true })
+ using (var form = new VoskModelDownload { AutoClose = true })
{
form.ShowDialog(this);
FillModels(comboBoxModels, form.LastDownloadedModel);
diff --git a/src/ui/Forms/SpeechRecognition/AudioToText.resx b/src/ui/Forms/AudioToText/VoskAudioToText.resx
similarity index 100%
rename from src/ui/Forms/SpeechRecognition/AudioToText.resx
rename to src/ui/Forms/AudioToText/VoskAudioToText.resx
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.Designer.cs b/src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.Designer.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.Designer.cs
rename to src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.Designer.cs
index d3335809c..97073eaab 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.Designer.cs
+++ b/src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.Designer.cs
@@ -1,6 +1,6 @@
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- sealed partial class AudioToTextSelectedLines
+ sealed partial class VoskAudioToTextSelectedLines
{
///
/// Required designer variable.
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.cs b/src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.cs
similarity index 95%
rename from src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.cs
rename to src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.cs
index 1a6b259d2..23db7649b 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.cs
+++ b/src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
@@ -10,9 +9,9 @@ using Nikse.SubtitleEdit.Core.Common;
using Nikse.SubtitleEdit.Logic;
using Vosk;
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- public sealed partial class AudioToTextSelectedLines : Form
+ public sealed partial class VoskAudioToTextSelectedLines : Form
{
private readonly string _voskFolder;
private bool _cancel;
@@ -26,7 +25,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
public Subtitle TranscribedSubtitle { get; private set; }
- public AudioToTextSelectedLines(List audioClips, Form parentForm)
+ public VoskAudioToTextSelectedLines(List audioClips, Form parentForm)
{
UiUtil.PreInitialize(this);
InitializeComponent();
@@ -48,7 +47,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing;
_voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk");
- AudioToText.FillModels(comboBoxModels, string.Empty);
+ VoskAudioToText.FillModels(comboBoxModels, string.Empty);
textBoxLog.Visible = false;
textBoxLog.Dock = DockStyle.Fill;
@@ -232,7 +231,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
if (rec.AcceptWaveform(buffer, bytesRead))
{
var res = rec.Result();
- var results = AudioToText.ParseJsonToResult(res);
+ var results = VoskAudioToText.ParseJsonToResult(res);
list.AddRange(results);
}
else
@@ -250,7 +249,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
}
var finalResult = rec.FinalResult();
- var finalResults = AudioToText.ParseJsonToResult(finalResult);
+ var finalResults = VoskAudioToText.ParseJsonToResult(finalResult);
list.AddRange(finalResults);
timer1.Stop();
return list;
@@ -344,10 +343,10 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
private void buttonDownload_Click(object sender, EventArgs e)
{
- using (var form = new AudioToTextModelDownload { AutoClose = true })
+ using (var form = new VoskModelDownload { AutoClose = true })
{
form.ShowDialog(this);
- AudioToText.FillModels(comboBoxModels, form.LastDownloadedModel);
+ VoskAudioToText.FillModels(comboBoxModels, form.LastDownloadedModel);
}
}
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.resx b/src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.resx
similarity index 100%
rename from src/ui/Forms/SpeechRecognition/AudioToTextSelectedLines.resx
rename to src/ui/Forms/AudioToText/VoskAudioToTextSelectedLines.resx
diff --git a/src/ui/Forms/SpeechRecognition/Dictate.Designer.cs b/src/ui/Forms/AudioToText/VoskDictate.Designer.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/Dictate.Designer.cs
rename to src/ui/Forms/AudioToText/VoskDictate.Designer.cs
index dc569a67f..808c51339 100644
--- a/src/ui/Forms/SpeechRecognition/Dictate.Designer.cs
+++ b/src/ui/Forms/AudioToText/VoskDictate.Designer.cs
@@ -1,6 +1,6 @@
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- partial class Dictate
+ partial class VoskDictate
{
///
/// Required designer variable.
diff --git a/src/ui/Forms/SpeechRecognition/Dictate.cs b/src/ui/Forms/AudioToText/VoskDictate.cs
similarity index 91%
rename from src/ui/Forms/SpeechRecognition/Dictate.cs
rename to src/ui/Forms/AudioToText/VoskDictate.cs
index ec58a8942..4558b7200 100644
--- a/src/ui/Forms/SpeechRecognition/Dictate.cs
+++ b/src/ui/Forms/AudioToText/VoskDictate.cs
@@ -1,17 +1,17 @@
-using NAudio.Wave;
-using Nikse.SubtitleEdit.Core.AudioToText;
-using Nikse.SubtitleEdit.Core.Common;
-using Nikse.SubtitleEdit.Logic;
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
+using NAudio.Wave;
+using Nikse.SubtitleEdit.Core.AudioToText;
+using Nikse.SubtitleEdit.Core.Common;
+using Nikse.SubtitleEdit.Logic;
using Vosk;
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- public partial class Dictate : Form
+ public partial class VoskDictate : Form
{
private static WaveFileWriter _waveFile;
private static Model _model;
@@ -21,7 +21,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
public static bool RecordingOn { get; set; }
public static double RecordingVolumePercent { get; set; }
- public Dictate()
+ public VoskDictate()
{
UiUtil.PreInitialize(this);
InitializeComponent();
@@ -33,7 +33,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
buttonOK.Text = LanguageSettings.Current.General.Ok;
buttonCancel.Text = LanguageSettings.Current.General.Cancel;
UiUtil.FixLargeFonts(this, buttonOK);
- AudioToText.FillModels(comboBoxModels, string.Empty);
+ VoskAudioToText.FillModels(comboBoxModels, string.Empty);
checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing;
}
@@ -82,7 +82,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
if (rec.AcceptWaveform(buffer, bytesRead))
{
var res = rec.Result();
- var results = AudioToText.ParseJsonToResult(res);
+ var results = VoskAudioToText.ParseJsonToResult(res);
list.AddRange(results);
}
else
@@ -93,7 +93,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
}
var finalResult = rec.FinalResult();
- var finalResults = AudioToText.ParseJsonToResult(finalResult);
+ var finalResults = VoskAudioToText.ParseJsonToResult(finalResult);
list.AddRange(finalResults);
try
@@ -175,10 +175,10 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
private void buttonDownload_Click(object sender, EventArgs e)
{
- using (var form = new AudioToTextModelDownload { AutoClose = true })
+ using (var form = new VoskModelDownload { AutoClose = true })
{
form.ShowDialog(this);
- AudioToText.FillModels(comboBoxModels, form.LastDownloadedModel);
+ VoskAudioToText.FillModels(comboBoxModels, form.LastDownloadedModel);
}
}
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.resx b/src/ui/Forms/AudioToText/VoskDictate.resx
similarity index 100%
rename from src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.resx
rename to src/ui/Forms/AudioToText/VoskDictate.resx
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.Designer.cs b/src/ui/Forms/AudioToText/VoskModelDownload.Designer.cs
similarity index 98%
rename from src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.Designer.cs
rename to src/ui/Forms/AudioToText/VoskModelDownload.Designer.cs
index 2739291e0..424a29749 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.Designer.cs
+++ b/src/ui/Forms/AudioToText/VoskModelDownload.Designer.cs
@@ -1,6 +1,6 @@
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- sealed partial class AudioToTextModelDownload
+ sealed partial class VoskModelDownload
{
///
/// Required designer variable.
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.cs b/src/ui/Forms/AudioToText/VoskModelDownload.cs
similarity index 97%
rename from src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.cs
rename to src/ui/Forms/AudioToText/VoskModelDownload.cs
index f186d9738..3df436c81 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextModelDownload.cs
+++ b/src/ui/Forms/AudioToText/VoskModelDownload.cs
@@ -7,15 +7,15 @@ using Nikse.SubtitleEdit.Core.AudioToText;
using Nikse.SubtitleEdit.Core.Common;
using Nikse.SubtitleEdit.Logic;
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- public sealed partial class AudioToTextModelDownload : Form
+ public sealed partial class VoskModelDownload : Form
{
public bool AutoClose { get; internal set; }
public string LastDownloadedModel { get; internal set; }
private readonly CancellationTokenSource _cancellationTokenSource;
- public AudioToTextModelDownload()
+ public VoskModelDownload()
{
UiUtil.PreInitialize(this);
InitializeComponent();
diff --git a/src/ui/Forms/SpeechRecognition/Dictate.resx b/src/ui/Forms/AudioToText/VoskModelDownload.resx
similarity index 100%
rename from src/ui/Forms/SpeechRecognition/Dictate.resx
rename to src/ui/Forms/AudioToText/VoskModelDownload.resx
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextWhisper.Designer.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.Designer.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/AudioToTextWhisper.Designer.cs
rename to src/ui/Forms/AudioToText/WhisperAudioToText.Designer.cs
index 8fce420fb..9be69ce26 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextWhisper.Designer.cs
+++ b/src/ui/Forms/AudioToText/WhisperAudioToText.Designer.cs
@@ -1,6 +1,6 @@
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- sealed partial class AudioToTextWhisper
+ sealed partial class WhisperAudioToText
{
///
/// Required designer variable.
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextWhisper.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs
similarity index 99%
rename from src/ui/Forms/SpeechRecognition/AudioToTextWhisper.cs
rename to src/ui/Forms/AudioToText/WhisperAudioToText.cs
index c7110c141..971b7cc65 100644
--- a/src/ui/Forms/SpeechRecognition/AudioToTextWhisper.cs
+++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs
@@ -1,8 +1,4 @@
-using Nikse.SubtitleEdit.Core.AudioToText;
-using Nikse.SubtitleEdit.Core.Common;
-using Nikse.SubtitleEdit.Core.SubtitleFormats;
-using Nikse.SubtitleEdit.Logic;
-using System;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
@@ -11,10 +7,14 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
+using Nikse.SubtitleEdit.Core.AudioToText;
+using Nikse.SubtitleEdit.Core.Common;
+using Nikse.SubtitleEdit.Core.SubtitleFormats;
+using Nikse.SubtitleEdit.Logic;
-namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
+namespace Nikse.SubtitleEdit.Forms.AudioToText
{
- public sealed partial class AudioToTextWhisper : Form
+ public sealed partial class WhisperAudioToText : Form
{
private readonly string _videoFileName;
private readonly int _audioTrackNumber;
@@ -31,7 +31,7 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
public Subtitle TranscribedSubtitle { get; private set; }
- public AudioToTextWhisper(string videoFileName, int audioTrackNumber, Form parentForm)
+ public WhisperAudioToText(string videoFileName, int audioTrackNumber, Form parentForm)
{
UiUtil.PreInitialize(this);
InitializeComponent();
@@ -299,7 +299,6 @@ namespace Nikse.SubtitleEdit.Forms.SpeechRecognition
var process = GetWhisperProcess(waveFileName, model.Name, comboBoxLanguages.Text, OutputHandler);
ShowProgressBar();
progressBar1.Style = ProgressBarStyle.Marquee;
- double seconds = 0;
buttonCancel.Visible = true;
try
{
diff --git a/src/ui/Forms/SpeechRecognition/AudioToTextWhisper.resx b/src/ui/Forms/AudioToText/WhisperAudioToText.resx
similarity index 100%
rename from src/ui/Forms/SpeechRecognition/AudioToTextWhisper.resx
rename to src/ui/Forms/AudioToText/WhisperAudioToText.resx
diff --git a/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.Designer.cs b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.Designer.cs
new file mode 100644
index 000000000..ed51ec6ba
--- /dev/null
+++ b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.Designer.cs
@@ -0,0 +1,327 @@
+namespace Nikse.SubtitleEdit.Forms.AudioToText
+{
+ sealed partial class WhisperAudioToTextSelectedLines
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.buttonCancel = new System.Windows.Forms.Button();
+ this.buttonGenerate = new System.Windows.Forms.Button();
+ this.progressBar1 = new System.Windows.Forms.ProgressBar();
+ this.labelProgress = new System.Windows.Forms.Label();
+ this.textBoxLog = new System.Windows.Forms.TextBox();
+ this.labelInfo = new System.Windows.Forms.Label();
+ this.groupBoxModels = new System.Windows.Forms.GroupBox();
+ this.buttonDownload = new System.Windows.Forms.Button();
+ this.linkLabelOpenModelsFolder = new System.Windows.Forms.LinkLabel();
+ this.labelModel = new System.Windows.Forms.Label();
+ this.comboBoxModels = new System.Windows.Forms.ComboBox();
+ this.linkLabeWhisperWebSite = new System.Windows.Forms.LinkLabel();
+ this.labelTime = new System.Windows.Forms.Label();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.checkBoxUsePostProcessing = new System.Windows.Forms.CheckBox();
+ this.groupBoxInputFiles = new System.Windows.Forms.GroupBox();
+ this.listViewInputFiles = new System.Windows.Forms.ListView();
+ this.columnHeaderFileName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.labelChooseLanguage = new System.Windows.Forms.Label();
+ this.comboBoxLanguages = new System.Windows.Forms.ComboBox();
+ this.groupBoxModels.SuspendLayout();
+ this.groupBoxInputFiles.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // buttonCancel
+ //
+ this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.buttonCancel.Location = new System.Drawing.Point(622, 427);
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.Size = new System.Drawing.Size(75, 23);
+ this.buttonCancel.TabIndex = 6;
+ this.buttonCancel.Text = "C&ancel";
+ this.buttonCancel.UseVisualStyleBackColor = true;
+ this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
+ //
+ // buttonGenerate
+ //
+ 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.Location = new System.Drawing.Point(491, 427);
+ this.buttonGenerate.Name = "buttonGenerate";
+ this.buttonGenerate.Size = new System.Drawing.Size(125, 23);
+ this.buttonGenerate.TabIndex = 5;
+ this.buttonGenerate.Text = "&Generate";
+ this.buttonGenerate.UseVisualStyleBackColor = true;
+ this.buttonGenerate.Click += new System.EventHandler(this.ButtonGenerate_Click);
+ //
+ // progressBar1
+ //
+ this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.progressBar1.Location = new System.Drawing.Point(12, 427);
+ this.progressBar1.Name = "progressBar1";
+ this.progressBar1.Size = new System.Drawing.Size(473, 12);
+ this.progressBar1.TabIndex = 4;
+ this.progressBar1.Visible = false;
+ //
+ // labelProgress
+ //
+ this.labelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.labelProgress.AutoSize = true;
+ this.labelProgress.Location = new System.Drawing.Point(12, 409);
+ this.labelProgress.Name = "labelProgress";
+ this.labelProgress.Size = new System.Drawing.Size(70, 13);
+ this.labelProgress.TabIndex = 4;
+ this.labelProgress.Text = "labelProgress";
+ //
+ // textBoxLog
+ //
+ this.textBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.textBoxLog.Location = new System.Drawing.Point(529, 9);
+ this.textBoxLog.Multiline = true;
+ this.textBoxLog.Name = "textBoxLog";
+ this.textBoxLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
+ this.textBoxLog.Size = new System.Drawing.Size(168, 258);
+ this.textBoxLog.TabIndex = 0;
+ //
+ // labelInfo
+ //
+ this.labelInfo.AutoSize = true;
+ this.labelInfo.Location = new System.Drawing.Point(12, 9);
+ this.labelInfo.Name = "labelInfo";
+ this.labelInfo.Size = new System.Drawing.Size(275, 13);
+ this.labelInfo.TabIndex = 1;
+ this.labelInfo.Text = "Generate text from audio via Whisper speech recognition";
+ //
+ // groupBoxModels
+ //
+ this.groupBoxModels.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBoxModels.Controls.Add(this.labelChooseLanguage);
+ this.groupBoxModels.Controls.Add(this.comboBoxLanguages);
+ this.groupBoxModels.Controls.Add(this.buttonDownload);
+ this.groupBoxModels.Controls.Add(this.linkLabelOpenModelsFolder);
+ this.groupBoxModels.Controls.Add(this.labelModel);
+ this.groupBoxModels.Controls.Add(this.comboBoxModels);
+ this.groupBoxModels.Location = new System.Drawing.Point(15, 66);
+ this.groupBoxModels.Name = "groupBoxModels";
+ this.groupBoxModels.Size = new System.Drawing.Size(682, 82);
+ this.groupBoxModels.TabIndex = 1;
+ this.groupBoxModels.TabStop = false;
+ this.groupBoxModels.Text = "Models";
+ //
+ // buttonDownload
+ //
+ this.buttonDownload.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.buttonDownload.Location = new System.Drawing.Point(503, 51);
+ this.buttonDownload.Name = "buttonDownload";
+ this.buttonDownload.Size = new System.Drawing.Size(28, 23);
+ this.buttonDownload.TabIndex = 1;
+ this.buttonDownload.Text = "...";
+ this.buttonDownload.UseVisualStyleBackColor = true;
+ this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click);
+ //
+ // linkLabelOpenModelsFolder
+ //
+ this.linkLabelOpenModelsFolder.AutoSize = true;
+ this.linkLabelOpenModelsFolder.Location = new System.Drawing.Point(539, 59);
+ this.linkLabelOpenModelsFolder.Name = "linkLabelOpenModelsFolder";
+ this.linkLabelOpenModelsFolder.Size = new System.Drawing.Size(98, 13);
+ this.linkLabelOpenModelsFolder.TabIndex = 2;
+ this.linkLabelOpenModelsFolder.TabStop = true;
+ this.linkLabelOpenModelsFolder.Text = "Open models folder";
+ this.linkLabelOpenModelsFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelOpenModelFolder_LinkClicked);
+ //
+ // labelModel
+ //
+ this.labelModel.AutoSize = true;
+ this.labelModel.Location = new System.Drawing.Point(254, 37);
+ this.labelModel.Name = "labelModel";
+ this.labelModel.Size = new System.Drawing.Size(167, 13);
+ this.labelModel.TabIndex = 0;
+ this.labelModel.Text = "Choose speech recognition model";
+ //
+ // comboBoxModels
+ //
+ this.comboBoxModels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBoxModels.FormattingEnabled = true;
+ this.comboBoxModels.Location = new System.Drawing.Point(257, 53);
+ this.comboBoxModels.Name = "comboBoxModels";
+ this.comboBoxModels.Size = new System.Drawing.Size(240, 21);
+ this.comboBoxModels.TabIndex = 0;
+ //
+ // linkLabeWhisperWebSite
+ //
+ this.linkLabeWhisperWebSite.AutoSize = true;
+ this.linkLabeWhisperWebSite.Location = new System.Drawing.Point(12, 26);
+ this.linkLabeWhisperWebSite.Name = "linkLabeWhisperWebSite";
+ this.linkLabeWhisperWebSite.Size = new System.Drawing.Size(85, 13);
+ this.linkLabeWhisperWebSite.TabIndex = 0;
+ this.linkLabeWhisperWebSite.TabStop = true;
+ this.linkLabeWhisperWebSite.Text = "Whisper website";
+ this.linkLabeWhisperWebSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelWhisperWebsite_LinkClicked);
+ //
+ // labelTime
+ //
+ this.labelTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.labelTime.AutoSize = true;
+ this.labelTime.Location = new System.Drawing.Point(12, 442);
+ this.labelTime.Name = "labelTime";
+ this.labelTime.Size = new System.Drawing.Size(88, 13);
+ this.labelTime.TabIndex = 6;
+ this.labelTime.Text = "Remaining time...";
+ //
+ // timer1
+ //
+ this.timer1.Interval = 1000;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ //
+ // checkBoxUsePostProcessing
+ //
+ this.checkBoxUsePostProcessing.AutoSize = true;
+ this.checkBoxUsePostProcessing.Location = new System.Drawing.Point(15, 162);
+ this.checkBoxUsePostProcessing.Name = "checkBoxUsePostProcessing";
+ this.checkBoxUsePostProcessing.Size = new System.Drawing.Size(312, 17);
+ this.checkBoxUsePostProcessing.TabIndex = 2;
+ this.checkBoxUsePostProcessing.Text = "Use post-processing (line merge, fix casing, and punctuation)";
+ this.checkBoxUsePostProcessing.UseVisualStyleBackColor = true;
+ //
+ // groupBoxInputFiles
+ //
+ this.groupBoxInputFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBoxInputFiles.Controls.Add(this.listViewInputFiles);
+ this.groupBoxInputFiles.Location = new System.Drawing.Point(15, 200);
+ this.groupBoxInputFiles.Name = "groupBoxInputFiles";
+ this.groupBoxInputFiles.Size = new System.Drawing.Size(682, 185);
+ this.groupBoxInputFiles.TabIndex = 3;
+ this.groupBoxInputFiles.TabStop = false;
+ this.groupBoxInputFiles.Text = "Input files";
+ //
+ // listViewInputFiles
+ //
+ this.listViewInputFiles.AllowDrop = true;
+ this.listViewInputFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.listViewInputFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeaderFileName});
+ this.listViewInputFiles.FullRowSelect = true;
+ this.listViewInputFiles.HideSelection = false;
+ this.listViewInputFiles.Location = new System.Drawing.Point(6, 18);
+ this.listViewInputFiles.Name = "listViewInputFiles";
+ this.listViewInputFiles.Size = new System.Drawing.Size(670, 150);
+ this.listViewInputFiles.TabIndex = 0;
+ this.listViewInputFiles.UseCompatibleStateImageBehavior = false;
+ this.listViewInputFiles.View = System.Windows.Forms.View.Details;
+ //
+ // columnHeaderFileName
+ //
+ this.columnHeaderFileName.Text = "File name";
+ this.columnHeaderFileName.Width = 455;
+ //
+ // labelChooseLanguage
+ //
+ this.labelChooseLanguage.AutoSize = true;
+ this.labelChooseLanguage.Location = new System.Drawing.Point(3, 37);
+ this.labelChooseLanguage.Name = "labelChooseLanguage";
+ this.labelChooseLanguage.Size = new System.Drawing.Size(90, 13);
+ this.labelChooseLanguage.TabIndex = 6;
+ this.labelChooseLanguage.Text = "Choose language";
+ //
+ // comboBoxLanguages
+ //
+ this.comboBoxLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBoxLanguages.FormattingEnabled = true;
+ this.comboBoxLanguages.Location = new System.Drawing.Point(6, 53);
+ this.comboBoxLanguages.Name = "comboBoxLanguages";
+ this.comboBoxLanguages.Size = new System.Drawing.Size(194, 21);
+ this.comboBoxLanguages.TabIndex = 7;
+ //
+ // WhisperAudioToTextSelectedLines
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(709, 464);
+ this.Controls.Add(this.groupBoxInputFiles);
+ this.Controls.Add(this.checkBoxUsePostProcessing);
+ this.Controls.Add(this.labelTime);
+ this.Controls.Add(this.linkLabeWhisperWebSite);
+ this.Controls.Add(this.groupBoxModels);
+ this.Controls.Add(this.labelInfo);
+ this.Controls.Add(this.labelProgress);
+ this.Controls.Add(this.progressBar1);
+ this.Controls.Add(this.buttonCancel);
+ this.Controls.Add(this.buttonGenerate);
+ this.Controls.Add(this.textBoxLog);
+ this.KeyPreview = true;
+ this.MinimumSize = new System.Drawing.Size(720, 450);
+ this.Name = "WhisperAudioToTextSelectedLines";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Audio to text";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AudioToText_FormClosing);
+ this.Load += new System.EventHandler(this.AudioToText_Load);
+ this.Shown += new System.EventHandler(this.AudioToTextSelectedLines_Shown);
+ this.ResizeEnd += new System.EventHandler(this.AudioToTextSelectedLines_ResizeEnd);
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AudioToText_KeyDown);
+ this.groupBoxModels.ResumeLayout(false);
+ this.groupBoxModels.PerformLayout();
+ this.groupBoxInputFiles.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button buttonCancel;
+ private System.Windows.Forms.Button buttonGenerate;
+ private System.Windows.Forms.ProgressBar progressBar1;
+ private System.Windows.Forms.Label labelProgress;
+ private System.Windows.Forms.TextBox textBoxLog;
+ private System.Windows.Forms.Label labelInfo;
+ private System.Windows.Forms.GroupBox groupBoxModels;
+ private System.Windows.Forms.LinkLabel linkLabeWhisperWebSite;
+ private System.Windows.Forms.Label labelModel;
+ private System.Windows.Forms.ComboBox comboBoxModels;
+ private System.Windows.Forms.LinkLabel linkLabelOpenModelsFolder;
+ private System.Windows.Forms.Label labelTime;
+ private System.Windows.Forms.Timer timer1;
+ private System.Windows.Forms.CheckBox checkBoxUsePostProcessing;
+ private System.Windows.Forms.Button buttonDownload;
+ private System.Windows.Forms.GroupBox groupBoxInputFiles;
+ private System.Windows.Forms.ListView listViewInputFiles;
+ private System.Windows.Forms.ColumnHeader columnHeaderFileName;
+ private System.Windows.Forms.Label labelChooseLanguage;
+ private System.Windows.Forms.ComboBox comboBoxLanguages;
+ }
+}
\ No newline at end of file
diff --git a/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs
new file mode 100644
index 000000000..7731222ff
--- /dev/null
+++ b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs
@@ -0,0 +1,446 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Windows.Forms;
+using Nikse.SubtitleEdit.Core.AudioToText;
+using Nikse.SubtitleEdit.Core.Common;
+using Nikse.SubtitleEdit.Logic;
+
+namespace Nikse.SubtitleEdit.Forms.AudioToText
+{
+ public sealed partial class WhisperAudioToTextSelectedLines : Form
+ {
+ private bool _cancel;
+ private int _batchFileNumber;
+ private readonly List _audioClips;
+ private readonly Form _parentForm;
+ private readonly Regex _timeRegex = new Regex(@"^\[\d\d:\d\d[\.,]\d\d\d --> \d\d:\d\d[\.,]\d\d\d\]", RegexOptions.Compiled);
+ private List _resultList;
+ private string _languageCode;
+
+ public Subtitle TranscribedSubtitle { get; private set; }
+
+ public WhisperAudioToTextSelectedLines(List audioClips, Form parentForm)
+ {
+ UiUtil.PreInitialize(this);
+ InitializeComponent();
+ UiUtil.FixFonts(this);
+ UiUtil.FixLargeFonts(this, buttonGenerate);
+ _parentForm = parentForm;
+
+ Text = LanguageSettings.Current.AudioToText.Title;
+ labelInfo.Text = LanguageSettings.Current.AudioToText.WhisperInfo;
+ groupBoxModels.Text = LanguageSettings.Current.AudioToText.LanguagesAndModels;
+ labelModel.Text = LanguageSettings.Current.AudioToText.ChooseModel;
+ linkLabelOpenModelsFolder.Text = LanguageSettings.Current.AudioToText.OpenModelsFolder;
+ checkBoxUsePostProcessing.Text = LanguageSettings.Current.AudioToText.UsePostProcessing;
+ buttonGenerate.Text = LanguageSettings.Current.Watermark.Generate;
+ buttonCancel.Text = LanguageSettings.Current.General.Cancel;
+ groupBoxInputFiles.Text = LanguageSettings.Current.BatchConvert.Input;
+ linkLabeWhisperWebSite.Text = LanguageSettings.Current.AudioToText.WhisperWebsite;
+
+ columnHeaderFileName.Text = LanguageSettings.Current.JoinSubtitles.FileName;
+
+ checkBoxUsePostProcessing.Checked = Configuration.Settings.Tools.VoskPostProcessing;
+
+ comboBoxLanguages.Items.Clear();
+ comboBoxLanguages.Items.AddRange(WhisperLanguage.Languages.ToArray