Fix opening filler with bare Instrumental and dual-gate QC.
selftest / selftest (push) Canceled after 0s
selftest / selftest (push) Canceled after 0s
ACE-Step no-vocal condition is the exact [Instrumental] marker; colon prose in the lyrics channel induced wordless filler. Recheck now ASRs full vocals and pairs filler ratio with demucs energy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+16
-11
@@ -23,19 +23,23 @@ def main(job):
|
||||
bars = int(job.get("intro_bars") or 8)
|
||||
lang = job.get("lang") or "zh"
|
||||
intro_sec = bars * 60.0 / bpm * 4.0
|
||||
# 多取 0.5s 余量
|
||||
take = min(intro_sec + 0.5, 60.0)
|
||||
|
||||
y, sr, ch = q._load_audio(path)
|
||||
n = int(take * sr)
|
||||
head = y[:max(1, n)]
|
||||
a = q.asr(head, sr, lang)
|
||||
# 与全量 qc 同口径:对整段 vocals 做 ASR,再按时间窗统计。
|
||||
# 只切前奏短窗喂 Whisper 会严重少计衬词(实测只吐 1 个「嗯」却 PASS)。
|
||||
v, vsr = q.vocals_of(path, job.get("cache_dir"))
|
||||
a = q.asr(v, vsr, lang)
|
||||
segs = a.get("segments") or []
|
||||
# 时间戳相对 clip 起点,整段都在前奏窗内
|
||||
stats = q.intro_filler_stats(segs, intro_sec + 1.0, lang)
|
||||
stats = q.intro_filler_stats(
|
||||
segs, intro_sec, lang, voc=v, vsr=vsr)
|
||||
hard = q.HARD
|
||||
fail = (stats["intro_filler_n"] >= hard["intro_filler_min_chars"]
|
||||
and stats["intro_filler_ratio"] >= hard["intro_filler_ratio"])
|
||||
ivr = float(stats.get("intro_voc_rms") or 0)
|
||||
ifn = int(stats["intro_filler_n"])
|
||||
ifr = float(stats["intro_filler_ratio"])
|
||||
# 有人声能量时降低字数门槛:短窗幻觉「单个嗯」也要拦
|
||||
eff_min = hard["intro_filler_min_chars"]
|
||||
if ivr >= hard["intro_voc_rms_min"]:
|
||||
eff_min = min(eff_min, 2)
|
||||
fail = (ifn >= eff_min and ifr >= hard["intro_filler_ratio"]
|
||||
and ivr >= hard["intro_voc_rms_min"])
|
||||
# 前 2s 真唱字(content words)也算开曲违规
|
||||
early = 0
|
||||
for s in segs:
|
||||
@@ -50,6 +54,7 @@ def main(job):
|
||||
intro_sec=round(intro_sec, 2),
|
||||
early_content=early,
|
||||
asr_head=(a.get("text") or "")[:160],
|
||||
eff_min=eff_min,
|
||||
**stats,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user