Multiple speakers not playing in sync
Shroototem opened this issue ยท 2 comments
Same issue as: #4
- Minecraft version: 1.18.2
- CC: Restitched version: v.1.100.5
- Detailed reproduction steps:
local speakers = table.pack(peripheral.find("speaker"))
local decoder = require("cc.audio.dfpwm").make_decoder()
local fn = {}
for chunk in io.lines("/disk/music/bo.dfpwm", 16 * 1024) do
local buffer = decoder(chunk)
for i, v in ipairs(speakers) do
fn[i] = function()
local name = peripheral.getName(v)
while not v.playAudio(buffer) do
repeat
until select(2, os.pullEvent("speaker_audio_empty")) == name
end
end
end
parallel.waitForAll(table.unpack(fn))
end