TIMAS_Bro

tts

May 11th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. local message = "DOORS IS CLOSING!"
  2.  
  3. local url = "https://www.dropbox.com/s/apu8mob9jjjx9ve/dvery2.dfpwm?dl=1"
  4. local response, err = http.get { url = url, binary = true }
  5. if not response then error(err, 0) end
  6. local speaker = peripheral.find("speaker")
  7. local decoder = require("cc.audio.dfpwm").make_decoder()
  8. while true do
  9. local chunk = response.read(16 * 1024)
  10. if not chunk then break end
  11.  
  12. local buffer = decoder(chunk)
  13. while not speaker.playAudio(buffer,300) do
  14. os.pullEvent("speaker_audio_empty")
  15. end
  16. end
Add Comment
Please, Sign In to add comment