From 9dbc6eb1827e8031a05ac30bcb39fa5e1bb719da Mon Sep 17 00:00:00 2001 From: allan716 <525223688@qq.com> Date: Sat, 20 Nov 2021 11:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: allan716 <525223688@qq.com> --- internal/pkg/sub_helper/sub_helper.go | 6 +++--- internal/pkg/sub_timeline_fixer/fixer.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/pkg/sub_helper/sub_helper.go b/internal/pkg/sub_helper/sub_helper.go index f494cf8e7..c2faa4625 100644 --- a/internal/pkg/sub_helper/sub_helper.go +++ b/internal/pkg/sub_helper/sub_helper.go @@ -383,7 +383,7 @@ func GetVADINfoFromSub(infoSrc *subparser.FileInfo, FrontAndEndPer float64, SubU 3. 可能还有一个需求,默认的模式是每五句话一个单元,还有一种模式是每一句话向后找到连续的四句话组成一个单元,允许重叠 目前看到的情况是前者的抽样率太低,需要使用后者的逻辑 */ -func GetVADINfoFromSubNeedOffsetTimeWillInsert(infoSrc *subparser.FileInfo, FrontAndEndPer float64, SubUnitMaxCount int, offsetTime float64, insert bool, kf *KeyFeatures) ([]SubUnit, error) { +func GetVADINfoFromSubNeedOffsetTimeWillInsert(infoSrc *subparser.FileInfo, SkipFrontAndEndPer float64, SubUnitMaxCount int, offsetTime float64, insert bool, kf *KeyFeatures) ([]SubUnit, error) { if SubUnitMaxCount < 0 { SubUnitMaxCount = 0 } @@ -411,8 +411,8 @@ func GetVADINfoFromSubNeedOffsetTimeWillInsert(infoSrc *subparser.FileInfo, Fron oneStart := my_util.Time2SecendNumber(oneDialogueExTimeStart) - if FrontAndEndPer > 0 { - if srcDuration*FrontAndEndPer > oneStart || srcDuration*(1.0-FrontAndEndPer) < oneStart { + if SkipFrontAndEndPer > 0 { + if srcDuration*SkipFrontAndEndPer > oneStart || srcDuration*(1.0-SkipFrontAndEndPer) < oneStart { continue } } diff --git a/internal/pkg/sub_timeline_fixer/fixer.go b/internal/pkg/sub_timeline_fixer/fixer.go index fb3067cef..ceeb8f93e 100644 --- a/internal/pkg/sub_timeline_fixer/fixer.go +++ b/internal/pkg/sub_timeline_fixer/fixer.go @@ -732,8 +732,8 @@ func (s *SubTimelineFixer) GetOffsetTimeV3(audioInfo vad.AudioInfo, infoSrc *sub const FixMask = "-fix" const bInsert = true // 是否插入点 const whichOne = 0 // 所有,whichOne = 1 只有 Start 的点 -const FrontAndEndPer = 0.15 // 前百分之 15 和后百分之 15 都不进行识别 -const SubUnitMaxCount = 50 // 一个 Sub单元有五句对白 +const FrontAndEndPer = 0.05 // 前百分之 15 和后百分之 15 都不进行识别 +const SubUnitMaxCount = 30 // 一个 Sub单元有五句对白 const ExpandTimeRange = 50 // 从字幕的时间轴片段需要向前和向后多匹配一部分的音频,这里定义的就是这个 range 以分钟为单位, 正负 60 秒 const KeyPer = 0.1 // 钥匙凹坑的占比 const MinCorrelation = 0.50 // 最低的匹配度