ws-audio2: audio/ac3 sniffs E-AC-3 too (loading one says UNSUPPORTED, not an unknown format); fixture tidy

This commit is contained in:
4DBug committed 2026-10-31 14:52:41 -05:00
1 parent 2d99b9924a
commit 62aded60c0
3 files changed
+6 -8

No files matched your search

+2 -7
View File
@@ -12,7 +12,7 @@
# tests/gen/ac3_cases.luau { name, data, channels, rate, frames, ref (f32le, WAVE order), refTool, refDrc?,
# dithered? }
# tests/gen/ac3_tracks.luau { name, data (the container), channels, rate, ref (ffmpeg's decode of the AC-3) }
import importlib.util, math, os, random, shutil, struct, subprocess, tempfile
import importlib.util, math, os, random, shutil, struct, tempfile
_spec = importlib.util.spec_from_file_location("_audio", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_audio.py"))
A = importlib.util.module_from_spec(_spec)
@@ -28,7 +28,6 @@ def _lit(b):
return '"' + "".join("\\x%02x" % x for x in b) + '"'
def crc16(data, crc=0):
"""A/52 section 7.10.1: x^16 + x^15 + x^2 + 1, MSB first, zero start"""
for b in data:
@@ -99,11 +98,7 @@ end
out[o:o + size] = f
return bytes(out)
# Both encoders set dithflag, and decoders draw their own random dither for the zero-bit mantissas, so two correct
# decoders differ by about the coding noise. The reference streams therefore have their dithflags cleared (the bit
# positions come from our decoder's dec.blocks, the CRCs are recomputed): ffmpeg and we then decode the same numbers.
# `dithered` keeps the encoder's original stream for a few cases.
#
# name, encoder, layout (ffmpeg) or (acmod, lfe) (aften), rate, kbps, extra options
CASES = [
("mono_48k", "ffmpeg", "mono", 48000, 96, []),