This commit is contained in:
2025-06-16 20:24:03 -04:00
parent e3970ac4ce
commit e4a91a47a6

View File

@@ -53,15 +53,17 @@ local function playFullFile(speaker, fileName)
file.close() file.close()
end end
local function playSound(speakers, fileName) local function playSound(placeholder,fileName)
local speakers = table.pack(peripheral.find("speaker"))
local tasks = {} local tasks = {}
for _, speaker in ipairs(speakers) do
table.insert(tasks, function() for i = 1, speakers.n do
playFullFile(speaker, fileName) tasks[i] = function()
end) playFullFile(speakers[i], fileName)
end
end end
parallel.waitForAll(table.unpack(tasks)) parallel.waitForAll(table.unpack(tasks, 1, speakers.n))
end end