Skip to content

Commit

Permalink
调整细节
Browse files Browse the repository at this point in the history
Signed-off-by: allan716 <525223688@qq.com>
  • Loading branch information
allanpk716 committed Nov 20, 2021
1 parent 32559cc commit 9dbc6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/sub_helper/sub_helper.go
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/sub_timeline_fixer/fixer.go
Expand Up @@ -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 // 最低的匹配度
Expand Down

0 comments on commit 9dbc6eb

Please sign in to comment.