Files
UnheardCity/ackit/known_setups.py
2026-10-09 02:48:24 +02:00

26 lines
622 B
Python

"""Database of Vorbis setups used by the game's own WEMs (from all shipped WADs).
Each entry: stripped Wwise setup (hex), its codebook hash, decode alloc sizes, and
formats seen. Reusing a known setup guarantees hash/alloc values the game accepts.
"""
import json
import os
PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", "known_setups.json")
_DB = None
def db():
global _DB
if _DB is None:
_DB = json.load(open(PATH))
return _DB
def lookup_setup(ww_setup: bytes):
h = ww_setup.hex()
for e in db():
if e["setup"] == h:
return e
return None