From e6ea2b6c7705167f78ed1b2fc6f4b5dd443abeeb Mon Sep 17 00:00:00 2001 From: rebecca Date: Sun, 1 Mar 2026 21:31:48 +0000 Subject: radio --- radio.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 radio.lua (limited to 'radio.lua') diff --git a/radio.lua b/radio.lua new file mode 100644 index 0000000..10fc431 --- /dev/null +++ b/radio.lua @@ -0,0 +1,16 @@ +local channel = 8888 + + +local radio = peripheral.find"radio_tower" +local speaker = peripheral.find"speaker" +assert(radio and speaker, "aaa") + +radio.setFrequency(channel) + +local channel_format = string.rep(48000,"b") +while true do + local _,_,data = os.pullEvent"radio_message" + assert(#data == 48000,"weird format") + speaker.playAudio(string.unpack(channel_format,data)) +end + -- cgit v1.2.3