Fix loading whisper from srt

This commit is contained in:
niksedk 2023-04-13 19:52:26 +02:00
parent 4b878aa920
commit f0db9eaa21
2 changed files with 11 additions and 3 deletions

View File

@ -616,7 +616,17 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
}
var whisperFolder = WhisperHelper.GetWhisperFolder() ?? string.Empty;
if (!File.Exists(srtFileName))
{
srtFileName = Path.Combine(whisperFolder, Path.GetFileNameWithoutExtension(waveFileName)) + ".srt";
}
var vttFileName = Path.Combine(whisperFolder, Path.GetFileName(waveFileName) + ".vtt");
if (!File.Exists(vttFileName))
{
vttFileName = Path.Combine(whisperFolder, Path.GetFileNameWithoutExtension(waveFileName)) + ".vtt";
}
if (!File.Exists(srtFileName) && !File.Exists(vttFileName))
{
resultTexts = new List<ResultText>();

View File

@ -79,8 +79,6 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
removeTemporaryFilesToolStripMenuItem.Checked = Configuration.Settings.Tools.WhisperDeleteTempFiles;
ContextMenuStrip = contextMenuStripWhisperAdvanced;
buttonDownload.Enabled = Configuration.Settings.Tools.WhisperChoice != WhisperChoice.CTranslate2;
}
private void ButtonGenerate_Click(object sender, EventArgs e)