Advertisement
osmarks

Untitled

Jan 18th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. local dfpwm = require("cc.audio.dfpwm")
  2. local speaker = peripheral.find("speaker")
  3.  
  4. while true do
  5. local dfpwm = require("cc.audio.dfpwm")
  6. local speaker = peripheral.find("speaker")
  7.  
  8. local decoder = dfpwm.make_decoder()
  9. for chunk in io.lines("data/example.dfpwm", 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. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement