ws-audio2: music/xm decodes ModPlug ADPCM samples (were silence), through codecs/audio/Adpcm.modplug

Fixture: tools/fixtures/_tracker.py write_xm gains an optional per-sample "adpcm" payload (two lines, shared with
the tracker generators, backward compatible); a new xm case renders the same as openmpt123.
This commit is contained in:
4DBug committed 2026-10-31 14:37:23 -05:00
1 parent 2717292366
commit 9466c5f471
7 files changed
+96 -13

No files matched your search

+8 -2
View File
@@ -1,5 +1,6 @@
-- music/xm tests: generated FastTracker 2 modules (tools/fixtures/xm.py) parsed, rendered through codecs/audio/Tracker and
-- compared with openmpt123's render (loudness envelope, band spectrum, stereo balance, song length), the XM writer's
-- compared with openmpt123's render (loudness envelope, band spectrum, stereo balance, song length; a ModPlug ADPCM
-- sample), the XM writer's
-- round trip, the contract, and the fuzz no-throw pass.
local T = require("@tests/T")
local S = require("@tests/music/_similar")
@@ -44,7 +45,12 @@ for _, c in Cases do
t:check(out, c.name .. ": encode " .. tostring(werr))
local m2 = Xm.decode(Bytes.reader(out :: buffer))
t:check(m2, c.name .. ": re-decode")
t:eq(buffer.tostring(out :: buffer), c.data, c.name .. ": round trip bytes")
if c.name == "adpcm" then
-- ModPlug ADPCM is written back as delta PCM: the same samples, not the same bytes
t:eq(buffer.tostring(m2.samples[1].data), buffer.tostring(m.samples[1].data), c.name .. ": samples kept")
else
t:eq(buffer.tostring(out :: buffer), c.data, c.name .. ": round trip bytes")
end
end
-- seek: the position after a seek and the output continuing