audio formats: comments are specs only

This commit is contained in:
4DBug committed 2026-11-01 01:53:49 -05:00
1 parent 0bd7b87d2b
commit 6ffbdbe0be
29 files changed
+143 -442

No files matched your search

+1 -6
View File
@@ -1,10 +1,7 @@
--!strict
--!native
--!optimize 2
-- audio/mp3/Index: the frame index of a stream, built once on open. It follows minimp3_ex's mp3dec_load_buf frame by frame
-- (same sync, resync and Xing / LAME handling), and simulates the layer III bit reservoir from the side info, so
-- it knows in advance which frames give output and where each one's samples land. That makes the total length
-- exact and seeking sample-accurate. Never throws.
-- audio/mp3/Index: the frame index as minimp3_ex's mp3dec_load_buf walks it, simulating the layer III bit reservoir.
local Header = require("@rosetta/codecs/audio/Mpa/Header")
local Core = require("@rosetta/codecs/audio/Mpa/Core")
@@ -29,7 +26,6 @@ export type Index = {
main: buffer, -- u16 layer III main data bytes per frame (0 for layers I / II)
outTotal: number, -- samples (per channel) of a continuous decode, delay not cut
bytes: number, -- audio bytes in indexed frames
-- format of the first frame
sampleRate: number,
channels: number, -- the most channels of any frame
layer: number,
@@ -89,7 +85,6 @@ function Index.build(b: buffer, start: number, stop: number): Index?
pos += i
end
if fs < 4 or fs > Core.MAX_FRAME then
-- cannot happen with a well-formed header, but never index an impossible frame
prev = -1
pos += max(fs, 1)
continue