mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Use SubtitleMaximumDisplayMilliseconds for ShortenLongTexts + rename
This commit is contained in:
parent
ae93b3204f
commit
929f47ccb4
@ -174,7 +174,7 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
|
||||
while (pctHere < percentageMax && startPos < p.EndTime.TotalSeconds - 1)
|
||||
{
|
||||
pctHere = FindPercentage(startPosForward - 0.05, startPosForward + 0.05, wavePeaks);
|
||||
if (Math.Abs(pctHere - (- 1)) < 0.01)
|
||||
if (Math.Abs(pctHere - (-1)) < 0.01)
|
||||
{
|
||||
if (p.DurationTotalMilliseconds < 1000)
|
||||
{
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user