Advertisement
N2AZ

cc_music_og

Oct 30th, 2024 (edited)
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. local dfpwm = require("cc.audio.dfpwm")
  2. local speaker = peripheral.find("speaker")
  3. local decoder = dfpwm.make_decoder()
  4.  
  5. print("Insert the direct link to your DFPWM file :")
  6. local lien = read()
  7.  
  8. local handle = assert(http.get(lien, nil, true))
  9. for chunk in handle.read, 16 * 1024 do
  10.   local buffer = decoder(chunk)
  11.   while not speaker.playAudio(buffer) do
  12.     os.pullEvent("speaker_audio_empty")
  13.   end
  14. end
  15. handle.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement