Marlingaming

CC Tweaked Wireless Speaker Program

Feb 23rd, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. local speaker = peripheral.find("speaker")
  2. local MID = 1
  3.  
  4. function SongPlayer(input)
  5. while not speaker.playAudio(input) do
  6. os.pullEvent("speaker_audio_empty")
  7. end
  8. end
  9.  
  10. rednet.open("top")
  11. while true do
  12. local id, message = rednet.receive(Protocol)
  13. if id == MID then
  14. SongPlayer(textutils.unserialize(message))
  15. os.pullEvent("speaker_audio_empty")
  16. end
  17. end
Add Comment
Please, Sign In to add comment