mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Add whisper setting WhisperMaxSegmentCharacters
This commit is contained in:
parent
b79d81fb0c
commit
4a1740a455
@ -414,6 +414,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
public string WhisperModel { get; set; }
|
||||
public string WhisperLanguageCode { get; set; }
|
||||
public string WhisperLocation { get; set; }
|
||||
public int WhisperMaxSegmentCharacters { get; set; }
|
||||
public string WhisperExtraSettings { get; set; }
|
||||
public int AudioToTextLineMaxChars { get; set; }
|
||||
public int AudioToTextLineMaxCharsJp { get; set; }
|
||||
@ -615,6 +616,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
GenVideoNonAssaBox = true;
|
||||
VoskPostProcessing = true;
|
||||
UseWhisperCpp = Configuration.IsRunningOnWindows;
|
||||
WhisperMaxSegmentCharacters = 1;
|
||||
WhisperExtraSettings = "";
|
||||
WhisperLanguageCode = "en";
|
||||
AudioToTextLineMaxChars = 86;
|
||||
@ -6149,6 +6151,12 @@ $HorzAlign = Center
|
||||
settings.Tools.WhisperLocation = subNode.InnerText;
|
||||
}
|
||||
|
||||
subNode = node.SelectSingleNode("WhisperMaxSegmentCharacters");
|
||||
if (subNode != null)
|
||||
{
|
||||
settings.Tools.WhisperMaxSegmentCharacters = int.Parse(subNode.InnerText, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
subNode = node.SelectSingleNode("WhisperExtraSettings");
|
||||
if (subNode != null)
|
||||
{
|
||||
@ -10409,6 +10417,7 @@ $HorzAlign = Center
|
||||
textWriter.WriteElementString("UseWhisperCpp", settings.Tools.UseWhisperCpp.ToString(CultureInfo.InvariantCulture));
|
||||
textWriter.WriteElementString("WhisperModel", settings.Tools.WhisperModel);
|
||||
textWriter.WriteElementString("WhisperLocation", settings.Tools.WhisperLocation);
|
||||
textWriter.WriteElementString("WhisperMaxSegmentCharacters", settings.Tools.WhisperMaxSegmentCharacters.ToString(CultureInfo.InvariantCulture));
|
||||
textWriter.WriteElementString("WhisperExtraSettings", settings.Tools.WhisperExtraSettings);
|
||||
textWriter.WriteElementString("WhisperLanguageCode", settings.Tools.WhisperLanguageCode);
|
||||
textWriter.WriteElementString("AudioToTextLineMaxChars", settings.Tools.AudioToTextLineMaxChars.ToString(CultureInfo.InvariantCulture));
|
||||
|
@ -636,7 +636,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
if (Configuration.Settings.Tools.UseWhisperCpp && string.IsNullOrEmpty(translateToEnglish))
|
||||
{
|
||||
translateToEnglish = "--max-len 1 ";
|
||||
translateToEnglish = $"--max-len {Configuration.Settings.Tools.WhisperMaxSegmentCharacters} ";
|
||||
}
|
||||
|
||||
var outputSrt = string.Empty;
|
||||
|
Loading…
Reference in New Issue
Block a user