1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-31 09:37:56 +00:00

Merge branch 'mc-1.16.x' into mc-1.17.x

This commit is contained in:
Jonathan Coates
2021-12-25 08:05:25 +00:00
14 changed files with 3162 additions and 36 deletions

View File

@@ -143,14 +143,14 @@ streams, or use different decoders for the same stream, the resulting audio may
@usage Reads "data/example.dfpwm" in blocks of 16KiB (the speaker can accept a maximum of 128×1024 samples), decodes
them and then plays them through the speaker.
```lua
```lua {data-peripheral=speaker}
local dfpwm = require "cc.audio.dfpwm"
local speaker = peripheral.find("speaker")
local decoder = dfpwm.make_decoder()
for input in io.lines("data/example.dfpwm", 16 * 1024 * 2) do
for input in io.lines("data/example.dfpwm", 16 * 1024) do
local decoded = decoder(input)
while not speaker.playAudio(output) do
while not speaker.playAudio(decoded) do
os.pullEvent("speaker_audio_empty")
end
end