Files
skate-3-rust-engine/tools/audio-e2e/wet_level.py
T
Hails 418dcecd41 Audio: interim cue tables retired, native water splash, published tools
- The interim cue tables and their opt-outs are gone; the native runtime is the only audio path. Old
  settings/audio.json files still load ("interim" / "native" ignored). Missing native data logs an error
  instead of falling back.
- Water splash from retail's mechanism (SFXObj_OffBoard start / update): Skate_Collisions 1187 / 1197 once
  per water stay, 1198 when the board is in water.
- The random interim riding bed is removed; riding collision and cloth sounds compared with the recomp
  (doc 11). Native output otherwise byte-identical (13 scenarios + 5 sessions).
- Published tools under tools/ (one folder per tool with a README; the recomp ones labelled for use with the
  research hooks), doc 14 and PR plan bucket L.
- Docs: doc 11 (retirement, bail density measured against the recomp, collision posts), doc 13 (usage guide).
2026-10-03 10:20:08 -06:00

41 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""The bus (wet) contribution of an e2e render: RMS of (wet render − dry render) against the dry RMS, over
the scenario's rolling frames, folded to stereo with the title's 0.707/0.5/0.5 table.
usage: py -3.13 wet_level.py DRY_DIR WET_DIR NAME [WET_DIR ...]"""
import csv
import math
import struct
import sys
if len(sys.argv) < 4 or sys.argv[1] in ('-h', '--help'):
sys.exit(__doc__)
dry_dir, name, wets = sys.argv[1], sys.argv[3], [sys.argv[2]] + sys.argv[4:]
def load(d):
raw = open(f'{d}/{name}.ours.f32', 'rb').read()
return struct.unpack(f'<{len(raw) // 4}f', raw)
rows = list(csv.DictReader(open(f'{dry_dir}/{name}.tsv'), delimiter='\t'))
dry = load(dry_dir)
SETTLE, SPF = 60, 800
frames = [f for f, r in enumerate(rows) if float(r['speed']) > 2 and r['state'] == '100']
def fold(p, k):
L, R, C, _, Ls, Rs = p[6 * k:6 * k + 6]
return 0.707 * L + 0.5 * C + 0.5 * Ls, 0.707 * R + 0.5 * C + 0.5 * Rs
for d in wets:
wet = load(d)
n = min(len(wet), len(dry)) // 6
ed = ew = 0.0
for f in frames:
for k in range((SETTLE + f) * SPF, min((SETTLE + f + 1) * SPF, n)):
dl, dr = fold(dry, k)
wl, wr = fold(wet, k)
ed += dl * dl + dr * dr
ew += (wl - dl) ** 2 + (wr - dr) ** 2
print(f'{d}: dry {10 * math.log10(ed / (2 * SPF * len(frames))):.1f} dBFS, bus part {10 * math.log10(ew / ed):+.1f} dB re dry')