Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local dfpwm = require("cc.audio.dfpwm")
- local speaker = table.pack(peripheral.find("speaker"))
- local x = os.time() -- Grabs time of World --
- local p = true
- print(x)
- print("Ready To Receive Song")
- rednet.open("top")
- local compId, compStr = rednet.receive()
- rednet.send(compId, "Song requested, now playing: ")
- rednet.send(compId, compStr)
- local decoder = dfpwm.make_decoder()
- for chunk in io.lines(compStr, 16 * 1024) do
- local buffer = decoder(chunk)
- for i = 1, speaker.n do
- while not speaker[i].playAudio(buffer) do
- os.pullEvent("speaker_audio_empty")
- end
- end
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement