Use SubtitleMaximumDisplayMilliseconds for ShortenLongTexts + rename

This commit is contained in:
Nikolaj Olsson 2024-01-31 20:01:52 +01:00
parent ae93b3204f
commit 929f47ccb4
2 changed files with 7 additions and 7 deletions

View File

@ -218,15 +218,15 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
return s;
}
public static Subtitle ShortenLongTexts(Subtitle subtitle)
public static Subtitle ShortenLongDuration(Subtitle subtitle)
{
var s = new Subtitle(subtitle);
foreach (var p in s.Paragraphs)
{
if (p.DurationTotalMilliseconds > 8000)
if (p.DurationTotalMilliseconds > Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds)
{
p.StartTime.TotalMilliseconds = p.EndTime.TotalMilliseconds - 5000;
p.StartTime.TotalMilliseconds = p.EndTime.TotalMilliseconds - Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds;
}
}

View File

@ -465,7 +465,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
if (checkBoxAutoAdjustTimings.Checked && wavePeaks != null)
{
transcript = WhisperTimingFixer.ShortenLongTexts(transcript);
transcript = WhisperTimingFixer.ShortenLongDuration(transcript);
transcript = WhisperTimingFixer.ShortenViaWavePeaks(transcript, wavePeaks);
}
@ -560,7 +560,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
if (checkBoxAutoAdjustTimings.Checked && wavePeaks != null)
{
transcript = WhisperTimingFixer.ShortenLongTexts(transcript);
transcript = WhisperTimingFixer.ShortenLongDuration(transcript);
transcript = WhisperTimingFixer.ShortenViaWavePeaks(transcript, wavePeaks);
}
@ -2132,7 +2132,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
if (checkBoxAutoAdjustTimings.Checked && wavePeaks != null)
{
_subtitle = WhisperTimingFixer.ShortenLongTexts(_subtitle);
_subtitle = WhisperTimingFixer.ShortenLongDuration(_subtitle);
_subtitle = WhisperTimingFixer.ShortenViaWavePeaks(_subtitle, wavePeaks);
}
else if (!checkBoxUsePostProcessing.Checked)