ws-audio2: bench lines for AHX / HVL render; type fixes (no new diagnostics); Types.Module format comment lists ahx / hvl

Types.luau: comment only.
This commit is contained in:
4DBug committed 2026-10-31 14:42:03 -05:00
1 parent d3ea84bb57
commit d2c470013d
8 files changed
+39 -18

No files matched your search

+21
View File
@@ -1078,3 +1078,24 @@ do
jitTune(false)
end
end
-- ws-audio2: chip/midi
do
-- AHX / HVL (codecs/audio/Hively): a whole song rendered at 44.1 kHz (tools/fixtures/ahx.py karma.ahx, 3 s; hvl.py
-- the 6-channel demo with ring modulation); MB/s of stereo f32 output, and how many times faster than real time
local Ahx, Hvl = require("@formats/music/ahx"), require("@formats/music/hvl")
local AC, HC = require("@tests/gen/ahx_cases"), require("@tests/gen/hvl_cases")
for _, spec in { { Ahx, AC, "karma.ahx", "ahx render karma (4 ch)" }, { Hvl, HC, "demo", "hvl render demo (6 ch)" } } do
for _, c in spec[2] do
if c.name == spec[3] then
local song = assert(spec[1].decode(Bytes.reader(buffer.fromstring(c.data))))
local frames = 0
local dt = bench(spec[4], 3, c.frames * 8, function()
local dec = song:render({ maxDuration = c.maxDuration })
frames = dec.frames
dec:read(frames)
end)
print(string.format("%-8s %-30s %8.1f x real time", runtime, "", frames / 44100 / dt))
end
end
end
end