rename: src/Formats -> src/Rosetta, @formats -> @rosetta requires, build/luajit/rosetta + rosetta._compat, build/roblox/Rosetta, ROSETTA_* env/globals, writer vendor strings
This commit is contained in:
1 parent
2956576d7f
commit
22ddcd78fa
941 files changed
+3364
-3364
No files matched your search
+3
-3
@@ -1,6 +1,6 @@
|
||||
-- Audio example (formats-luau): build a sound, edit it with F.ops.audio, encode it to several formats, then stream it
|
||||
-- Audio example (rosetta): build a sound, edit it with F.ops.audio, encode it to several formats, then stream it
|
||||
-- back with a Decoder. Run from the repository root: luau examples/audio.luau (docs/guide/audio.md explains the API).
|
||||
local F = require("@formats")
|
||||
local F = require("@rosetta")
|
||||
local A = F.ops.audio
|
||||
|
||||
-- 1. one second of a stereo chord: interleaved f32 samples, frame i / channel c at byte (i * channels + c) * 4
|
||||
@@ -11,7 +11,7 @@ for i = 0, tone.frames - 1 do
|
||||
buffer.writef32(tone.samples, (i * 2) * 4, 0.3 * math.sin(2 * math.pi * 261.63 * t)) -- left: C4
|
||||
buffer.writef32(tone.samples, (i * 2 + 1) * 4, 0.3 * math.sin(2 * math.pi * 329.63 * t)) -- right: E4
|
||||
end
|
||||
tone.tags = { title = "Example chord", artist = "formats-luau" }
|
||||
tone.tags = { title = "Example chord", artist = "rosetta" }
|
||||
|
||||
-- 2. edit: fade, normalize, a mono copy at 16 kHz, then the two one after the other
|
||||
local shaped = assert(A.normalize(assert(A.fade(tone, 0.05, 0.2)), 0.8))
|
||||
|
||||
Reference in new issue
Block a user