Browse Source

调整细节

Signed-off-by: allan716 <[email protected]>
allan716 4 years ago
parent
commit
9dbc6eb182
2 changed files with 5 additions and 5 deletions
  1. 3 3
      internal/pkg/sub_helper/sub_helper.go
  2. 2 2
      internal/pkg/sub_timeline_fixer/fixer.go

+ 3 - 3
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
 			}
 		}

+ 2 - 2
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 // 最低的匹配度