Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 3.56 KB

File metadata and controls

83 lines (53 loc) · 3.56 KB

Algorithm and thresholds

SpliceSentry v0.1.0 analyzes a 500 ms context window on each side of every supplied cut. It reads those windows directly from the WAV data chunk and evaluates every channel independently. The cut verdict is the worst finding across all channels.

These measurements are deterministic heuristics, not a perceptual model or delivery certification.

1. Sample discontinuity

The splice jump is the absolute difference between the last sample before the cut and the first sample after it.

To distinguish a cut from ordinary waveform motion, SpliceSentry also measures absolute first differences in the nearest 20 ms on both sides. The relative ratio is:

jump / max(median(local differences) + 6 × MAD(local differences), 0.000001)

Both the absolute and relative conditions must be met:

Severity Jump Relative ratio
Review at least -36 dBFS at least 4×
Fail at least -24 dBFS at least 6×

This dual threshold reduces false findings on naturally fast waveform changes, but a speech transient exactly at a marker can still look suspicious.

2. Short-window level

The tool compares RMS dBFS over the nearest 50 ms before and after the cut.

Severity Absolute level difference
Review at least 6 dB
Fail at least 12 dB

This check can intentionally flag a cut between different speech energies. The result tells the editor where to listen; it does not assert that clip gain is always required.

3. Quiet-context selection

Room-tone checks exclude the nearest 10 ms on each side of the splice, then divide the remaining context into non-overlapping 40 ms frames. A frame is at least 32 samples so the FFT remains defined at unusually low sample rates. The quietest frame on each side is selected.

A selected frame is usable when either:

  • its level is at or below -35 dBFS; or
  • it is at least 6 dB quieter than the median candidate frame on that side.

Digital silence is removed from the candidate set rather than selected as room tone. Other real low-level frames on that side remain eligible. If either side has no eligible frame, the report records insufficient_quiet_context and emits no room-tone verdict.

4. Room-tone level

When both quiet frames are eligible, their RMS difference is scored:

Severity Absolute difference
Review at least 5 dB
Fail at least 10 dB

5. Room-tone color

Each quiet frame is mean-centered and Hann-windowed. A radix-2 FFT of up to 4096 samples produces normalized energy in four bands:

  1. below 250 Hz;
  2. 250 Hz to below 1 kHz;
  3. 1 kHz to below 4 kHz;
  4. 4 kHz and above.

SpliceSentry compares the normalized profiles with Hellinger distance, which ranges from 0 for identical distributions to 1 for disjoint distributions.

Severity Spectral distance
Review at least 0.35
Fail at least 0.75

Window and threshold record

Every report.json embeds the exact windows and thresholds used. Thresholds are fixed in the v0.1.0 CLI so results are comparable between runs. A future threshold configuration would require an explicit versioned contract rather than hidden tuning.

Known limits

  • Markers must already be known; there is no automatic edit detection.
  • Phase, reverb tails, codec artifacts, and subjective masking are not modeled.
  • The room-tone fingerprint is deliberately coarse and does not identify a recording environment.
  • A pass means no configured finding fired, not that the edit is inaudible.
  • Results should be reviewed against the real program mix and delivery context.