mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fix crash in Vosk audio to text on selected lines - thx MediaExpres :)
Fix #8530 Fix crash when Vosk is not installed
This commit is contained in:
parent
37d821130c
commit
8810ecd950
@ -9832,6 +9832,28 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk");
|
||||||
|
if (!Directory.Exists(voskFolder))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(voskFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Configuration.IsRunningOnWindows && !HasCurrentVosk(voskFolder))
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(string.Format(LanguageSettings.Current.Settings.DownloadX, "libvosk"), "Subtitle Edit", MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var form = new DownloadVosk())
|
||||||
|
{
|
||||||
|
if (form.ShowDialog(this) != DialogResult.OK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var audioClips = GetAudioClips();
|
var audioClips = GetAudioClips();
|
||||||
|
|
||||||
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 10_000)
|
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 10_000)
|
||||||
|
Loading…
Reference in New Issue
Block a user