ws-audio2: audio/brstm variant() names bcstm / bfstm for F.detect

This commit is contained in:
4DBug committed 2026-10-31 14:28:31 -05:00
1 parent 5e64334e85
commit 3f6823cbe5
2 files changed
+9 -1

No files matched your search

+6
View File
@@ -44,6 +44,12 @@ function Brstm.sniff(r: Bytes.Reader): number
return if bom == "\254\255" or bom == "\255\254" then 1 else 0
end
-- variant(r) -> "brstm" / "bcstm" / "bfstm": the flavour, for F.detect
function Brstm.variant(r: Bytes.Reader): string?
local m = r:peek(4)
return if m == "RSTM" then "brstm" elseif m == "CSTM" then "bcstm" elseif m == "FSTM" then "bfstm" else nil
end
-- ------------------------------------------------------------------------------------------------ decode
function Brstm.decode(r: Bytes.Reader, opts: DecodeOptions?): (Types.Audio?, Err.Err?)
local dec, err = Brstm.open(r)