audio formats: comments are specs only
This commit is contained in:
1 parent
0bd7b87d2b
commit
6ffbdbe0be
29 files changed
+143
-442
No files matched your search
@@ -1,13 +1,7 @@
|
||||
--!strict
|
||||
-- audio/ape: Monkey's Audio (.ape) files around codecs/audio/Ape: the header in front (after an optional ID3v2 tag),
|
||||
-- the frames (each independent: sample-accurate seeking through the seek table), APEv2 tags at the end
|
||||
-- (codecs/audio/ApeTag). Written from the Monkey's Audio SDK 13.28 (BSD 3-clause, licenses/monkeys-audio-LICENSE.txt).
|
||||
-- Supports file versions 3.95 and later, every compression level, 8 - 32-bit integer and 32-bit float, 1 - 32
|
||||
-- channels (as the source WAV ordered them). Not supported: files before 3.95, encoding.
|
||||
--
|
||||
-- local dec = Ape.open(Bytes.reader(buf)) -- Types.Decoder + bitsPerSample, level, version, float, md5
|
||||
-- local i32, n = dec:readInt(4096) -- integer files: the samples as `mac -d` writes them
|
||||
-- local audio = Ape.decode(Bytes.reader(buf)) -- Types.Audio
|
||||
-- audio/ape: Monkey's Audio (.ape) via codecs/audio/Ape and ApeTag, from the Monkey's Audio SDK 13.28 (BSD 3-clause,
|
||||
-- licenses/monkeys-audio-LICENSE.txt). Supports: versions 3.95+, every level, 8-32-bit integer and 32-bit float, 1-32
|
||||
-- channels, an ID3v2 prefix, seeking by the seek table. Not supported: files before 3.95, encoding.
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ requires
|
||||
local Err = require("@rosetta/core/Err")
|
||||
@@ -30,7 +24,7 @@ local Ape = {
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ types
|
||||
export type OpenOptions = {
|
||||
maxFrames: number?, -- decode(): refuse longer streams (default 2^28)
|
||||
maxFrames: number?, -- default 2^28
|
||||
}
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ constants
|
||||
@@ -59,7 +53,6 @@ function Ape.sniff(r: Bytes.Reader): number
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ decode
|
||||
-- decode(r, opts?) -> Types.Audio | nil, Err: the whole stream
|
||||
function Ape.decode(r: Bytes.Reader, opts: OpenOptions?): (Types.Audio?, Err.Err?)
|
||||
local dec, err = Ape.open(r, opts)
|
||||
if not dec then
|
||||
@@ -74,7 +67,6 @@ function Ape.decode(r: Bytes.Reader, opts: OpenOptions?): (Types.Audio?, Err.Err
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ open
|
||||
-- open(r, opts?) -> Decoder | nil, Err
|
||||
function Ape.open(r: Bytes.Reader, opts: OpenOptions?): (Types.Decoder?, Err.Err?)
|
||||
if type(r) == "buffer" then
|
||||
r = Bytes.reader(r :: any)
|
||||
|
||||
Reference in new issue
Block a user