# Docs input for the HE-AAC section of docs/guide/audio.md (tools/fixtures.py; tools/docs_check.py reads it): half a # second of HE-AACv2 (SBR + PS) in ADTS from fdkaac, 48 kHz output from a 24 kHz mono core. # tests/gen/docs_heaac.luau { files = { ["radio.aac"] = bytes }, vars = { heAacBytes = "radio.aac" } } import importlib.util, math, os, struct, tempfile INPUTS = ["tools/docs_check.py"] def generate(ctx): spec = importlib.util.spec_from_file_location("docs_heaac_check", os.path.join(ctx.root, "tools", "docs_check.py")) dc = importlib.util.module_from_spec(spec) spec.loader.exec_module(dc) rate, n = 48000, 24000 ints = [] for i in range(n): t = i / rate for c in range(2): v = 0.3 * math.sin(2 * math.pi * (330 + 110 * c) * t) + 0.1 * math.sin(2 * math.pi * 7000 * t + c) ints.append(int(v * 32767)) data = struct.pack("<%dh" % len(ints), *ints) fmt = struct.pack("