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
@ -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