Show warning for running non-English with English-only models - thx Purfview :)

Related to ae5c93d634 (commitcomment-140600266)
This commit is contained in:
Nikolaj Olsson 2024-04-04 14:58:22 +02:00
parent 90731f97e0
commit 6a9c8465bc

View File

@ -384,6 +384,19 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
return; return;
} }
_languageCode = GetLanguage(comboBoxLanguages.Text);
if (comboBoxModels.Items[comboBoxModels.SelectedIndex] is WhisperModel model &&
_languageCode != "en" && model.Name.EndsWith(".en", StringComparison.InvariantCulture))
{
var result = MessageBox.Show("English model should only be used with English language." + Environment.NewLine +
"Continue anyway?", Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
if (result != DialogResult.Yes)
{
return;
}
}
try try
{ {
var f = SeLogger.GetWhisperLogFilePath(); var f = SeLogger.GetWhisperLogFilePath();
@ -400,7 +413,6 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
_useCenterChannelOnly = Configuration.Settings.General.FFmpegUseCenterChannelOnly && _useCenterChannelOnly = Configuration.Settings.General.FFmpegUseCenterChannelOnly &&
FfmpegMediaInfo.Parse(_videoFileName).HasFrontCenterAudio(_audioTrackNumber); FfmpegMediaInfo.Parse(_videoFileName).HasFrontCenterAudio(_audioTrackNumber);
_languageCode = GetLanguage(comboBoxLanguages.Text);
IncompleteModel = false; IncompleteModel = false;
ShowProgressBar(); ShowProgressBar();