Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArg = {...}
- local FolderPath = tArg[2]
- local FrameRate = 1
- local Frames = {}
- local Audio
- local monitor = peripheral.find("monitor")
- term.clear()
- function Play()
- for i = 1, #List do
- local Image = paintutils.loadImage(fs.combine(FolderPath,List[i]))
- paintutils.drawImage(Image,1,1)
- os.sleep(FrameRate)
- end
- end
- function PlayAudio()
- local dfpwm = require "cc.audio.dfpwm"
- local decoder = dfpwm.make_decoder()
- local speaker = peripheral.find("speaker")
- for input in io.lines(Audio, 16 * 1024) do
- local decoded = decoder(input)
- rednet.broadcast(textutils.serialize(decoded))
- end
- end
- function Movie()
- term.redirect(monitor)
- parallel.waitForAll(Play,PlayAudio)
- end
- function GetFile()
- local Path = fs.open(fs.combine(FolderPath,"Data.txt"),"r")
- FrameRate = file.readLine()
- Audio = file.readLine()
- local Content
- repeat
- Content = file.readLine()
- Frames[#Frames + 1] = Content
- until Content == nil
- Movie()
- end
- rednet.open("top")
- GetFile()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement