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()
- for chunk in io.lines("data/example.dfpwm", 16 * 1024) do
- local buffer = decoder(chunk)
- while not speaker.playAudio(buffer) do
- os.pullEvent("speaker_audio_empty")
- end
- end
Add Comment
Please, Sign In to add comment