Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local dfpwm = require("cc.audio.dfpwm")
- local speaker = peripheral.find("speaker")
- local decoder = dfpwm.make_decoder()
- print("Insert the direct link to your DFPWM file :")
- local lien = read()
- local handle = assert(http.get(lien, nil, true))
- for chunk in handle.read, 16 * 1024 do
- local buffer = decoder(chunk)
- while not speaker.playAudio(buffer) do
- os.pullEvent("speaker_audio_empty")
- end
- end
- handle.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement