ws-apifix: one bitrate unit: every encoder's bitrate option is bit/s (MP3 now too), values below 1000 are kbit/s (the old MP3 values keep working; Opus accepts them too); the MP3 Decoder's bitrate field is bit/s as the Decoder contract says (was kbit/s)

This commit is contained in:
4DBug committed 2026-10-31 14:06:51 -05:00
1 parent 3c2a646365
commit ac47545aa3
10 files changed
+35 -14

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ end
`F.convert` streams audio: the encoder reads the decoder as it goes.
```luau
local mp3 = assert(F.convert(flacBytes, "mp3", { bitrate = 192 })) -- MP3 bit rates are in kbit/s
local mp3 = assert(F.convert(flacBytes, "mp3", { bitrate = 192000 })) -- bit rates are in bit/s
local dec = assert(F.audio.open(mp3))
assert(dec.sampleRate == 44100 and dec.channels == 2)
assert(math.abs(dec.duration - 1) < 0.1)