mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
The voice check judges the bed only on enough gaps between words
Body Shop's host-hook cut read "1.5 dB above what's under it" off a single 0.34 s gap between two "Mmm"s, where the speaker was still humming; the agent's own measure (pauses of 0.8 s and more) read 11.7 dB. A tightly cut take has few gaps, so the bed is judged only on 3 or more gaps and 1 s of them in all.
This commit is contained in:
1 parent
118b58f4de
commit
dcfaaba739
1 file changed
+8
-2
@@ -27,6 +27,9 @@ const LINE_GAP = 0.7
|
||||
const CLEAR = 0.12
|
||||
/** a gap shorter than this is too short to read the bed in (s) */
|
||||
const GAP_MIN = 0.2
|
||||
/** the bed is judged only on this many gaps between words, this many 10 ms frames of them in all */
|
||||
const BED_GAPS = 3
|
||||
const BED_FRAMES = 100
|
||||
/** the level a span is read at: its loud end (this percentile of its 10 ms frames), so pauses inside words don't count */
|
||||
const Q = 0.8
|
||||
|
||||
@@ -55,15 +58,18 @@ export function voice(db: number[], heard: Word[]): Finding[] {
|
||||
const speech: number[] = []
|
||||
for (const w of heard) speech.push(...frames(db, w.start, w.end))
|
||||
const bed: number[] = []
|
||||
let gaps = 0
|
||||
const lines = linesOf(heard)
|
||||
// the gaps inside lines and between lines close together: what's under the talking, not the end card's music
|
||||
for (let k = 1; k < heard.length; k++) {
|
||||
const a = heard[k - 1].end + CLEAR
|
||||
const b = heard[k].start - CLEAR
|
||||
if (b - a >= GAP_MIN && b - a < 2.5) bed.push(...frames(db, a, b))
|
||||
if (b - a >= GAP_MIN && b - a < 2.5) { bed.push(...frames(db, a, b)); gaps++ }
|
||||
}
|
||||
const S = pct(speech, Q)
|
||||
if (bed.length >= 20) {
|
||||
// enough of the bed to judge: a tightly cut take has few gaps, and one of them is often still a hum or a breath
|
||||
// (11-30: Body Shop's host hook read 1.5 dB off a single 0.34 s gap between two "Mmm"s)
|
||||
if (gaps >= BED_GAPS && bed.length >= BED_FRAMES) {
|
||||
const B = pct(bed, Q)
|
||||
const over = S - B
|
||||
if (over < ON_TOP_WARN) out.push({ level: over < ON_TOP_ERROR ? "error" : "warn", kind: "buried", at: heard[0].start, says: `the dialogue is only ${over.toFixed(1)} dB above what's under it between words (music, effects, the street): it should be ${ON_TOP_WARN} dB or more on top. Duck the music further under the voice, or lift the voice` })
|
||||
|
||||
Reference in new issue
Block a user