diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml index e7823d172..cdef35f86 100644 --- a/LanguageBaseEnglish.xml +++ b/LanguageBaseEnglish.xml @@ -3374,6 +3374,7 @@ Keep changes? Split at cursor Merge with previous Merge with next + Run Whisper on selected paragraph... Extend to previous Extend to next Play selection diff --git a/src/ui/Forms/Main.Designer.cs b/src/ui/Forms/Main.Designer.cs index 0114cdd5c..052e289d2 100644 --- a/src/ui/Forms/Main.Designer.cs +++ b/src/ui/Forms/Main.Designer.cs @@ -579,6 +579,7 @@ namespace Nikse.SubtitleEdit.Forms this.timerOriginalTextUndo = new System.Windows.Forms.Timer(this.components); this.contextMenuStripShowVideoControls = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItemShowVideoControls = new System.Windows.Forms.ToolStripMenuItem(); + this.runWhiperOnParagraphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -2721,7 +2722,7 @@ namespace Nikse.SubtitleEdit.Forms this.toolStripMenuItemSelectedLines, this.toolStripMenuItemGoogleMicrosoftTranslateSelLine}); this.contextMenuStripListView.Name = "contextMenuStripListView"; - this.contextMenuStripListView.Size = new System.Drawing.Size(285, 848); + this.contextMenuStripListView.Size = new System.Drawing.Size(285, 826); this.contextMenuStripListView.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.MenuClosed); this.contextMenuStripListView.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListViewOpening); this.contextMenuStripListView.Opened += new System.EventHandler(this.MenuOpened); @@ -4459,6 +4460,7 @@ namespace Nikse.SubtitleEdit.Forms this.splitToolStripMenuItem1, this.mergeWithPreviousToolStripMenuItem, this.mergeWithNextToolStripMenuItem, + this.runWhiperOnParagraphToolStripMenuItem, this.toolStripSeparator11, this.extendToPreviousToolStripMenuItem, this.extendToNextToolStripMenuItem, @@ -4475,7 +4477,7 @@ namespace Nikse.SubtitleEdit.Forms this.seekSilenceToolStripMenuItem, this.insertSubtitleHereToolStripMenuItem}); this.contextMenuStripWaveform.Name = "contextMenuStripWaveform"; - this.contextMenuStripWaveform.Size = new System.Drawing.Size(275, 490); + this.contextMenuStripWaveform.Size = new System.Drawing.Size(275, 534); this.contextMenuStripWaveform.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.ContextMenuStripWaveformClosing); this.contextMenuStripWaveform.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripWaveformOpening); // @@ -5879,6 +5881,13 @@ namespace Nikse.SubtitleEdit.Forms this.toolStripMenuItemShowVideoControls.Text = "Show video controls"; this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.ToolStripMenuItemShowVideoControlsClick); // + // runWhiperOnParagraphToolStripMenuItem + // + this.runWhiperOnParagraphToolStripMenuItem.Name = "runWhiperOnParagraphToolStripMenuItem"; + this.runWhiperOnParagraphToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + this.runWhiperOnParagraphToolStripMenuItem.Text = "Run Whiper on paragraph..."; + this.runWhiperOnParagraphToolStripMenuItem.Click += new System.EventHandler(this.runWhiperOnParagraphToolStripMenuItem_Click); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -6497,5 +6506,6 @@ namespace Nikse.SubtitleEdit.Forms private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemEvenlyDistributeLines; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemVerifyCompleteness; private System.Windows.Forms.ToolStripButton toolStripButtonVideoOpen; + private System.Windows.Forms.ToolStripMenuItem runWhiperOnParagraphToolStripMenuItem; } } \ No newline at end of file diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 65b57c120..d7e3770fd 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -939,6 +939,7 @@ namespace Nikse.SubtitleEdit.Forms deleteParagraphToolStripMenuItem.Visible = false; toolStripMenuItemFocusTextbox.Visible = true; splitToolStripMenuItem1.Visible = false; + runWhiperOnParagraphToolStripMenuItem.Visible = false; mergeWithPreviousToolStripMenuItem.Visible = false; mergeWithNextToolStripMenuItem.Visible = false; extendToPreviousToolStripMenuItem.Visible = false; @@ -1132,6 +1133,7 @@ namespace Nikse.SubtitleEdit.Forms deleteParagraphToolStripMenuItem.Visible = true; toolStripMenuItemFocusTextbox.Visible = true; splitToolStripMenuItem1.Visible = true; + runWhiperOnParagraphToolStripMenuItem.Visible = e.Paragraph.DurationTotalMilliseconds > 8000; mergeWithPreviousToolStripMenuItem.Visible = true; mergeWithNextToolStripMenuItem.Visible = true; toolStripSeparator11.Visible = true; @@ -2089,8 +2091,8 @@ namespace Nikse.SubtitleEdit.Forms toolStripMenuItemFocusTextbox.Text = languageWaveform.FocusTextBox; goToPreviousSubtitleStripMenuItem.Text = languageWaveform.GoToPrevious; goToNextSubtitleStripMenuItem.Text = languageWaveform.GoToNext; - splitToolStripMenuItem1.Text = languageWaveform.Split; + runWhiperOnParagraphToolStripMenuItem.Text = languageWaveform.RunWhisperSelectedParagraph; mergeWithPreviousToolStripMenuItem.Text = languageWaveform.MergeWithPrevious; mergeWithNextToolStripMenuItem.Text = languageWaveform.MergeWithNext; extendToPreviousToolStripMenuItem.Text = languageWaveform.ExtendToPrevious; @@ -9840,7 +9842,7 @@ namespace Nikse.SubtitleEdit.Forms } var audioClips = GetAudioClips(); - if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 10_000) + if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 8_000) { var s = new Subtitle(); s.Paragraphs.Add(audioClips[0].Paragraph); @@ -36710,5 +36712,10 @@ namespace Nikse.SubtitleEdit.Forms { OpenVideoDialog(); } + + private void runWhiperOnParagraphToolStripMenuItem_Click(object sender, EventArgs e) + { + AudioToTextWhisperSelectedLines(); + } } } \ No newline at end of file diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 4d3a5d40d..0efaaa18b 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -3796,6 +3796,7 @@ Keep changes?", MergeWithNext = "Merge with next", ExtendToPrevious = "Extend to previous", ExtendToNext = "Extend to next", + RunWhisperSelectedParagraph = "Run Whisper on selected paragraph...", PlaySelection = "Play selection", ShowWaveformAndSpectrogram = "Show waveform and spectrogram", ShowWaveformOnly = "Show waveform only", diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index 95f530c31..e0460c95e 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -9205,6 +9205,9 @@ namespace Nikse.SubtitleEdit.Logic case "Waveform/MergeWithNext": language.Waveform.MergeWithNext = reader.Value; break; + case "Waveform/RunWhisperSelectedParagraph": + language.Waveform.RunWhisperSelectedParagraph = reader.Value; + break; case "Waveform/ExtendToPrevious": language.Waveform.ExtendToPrevious = reader.Value; break; diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index 5016966a8..7e3d1c3cc 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -3602,6 +3602,7 @@ public string SplitAtCursor { get; set; } public string MergeWithPrevious { get; set; } public string MergeWithNext { get; set; } + public string RunWhisperSelectedParagraph { get; set; } public string ExtendToPrevious { get; set; } public string ExtendToNext { get; set; } public string PlaySelection { get; set; }