blob: 10fc431981f05cb2710e1f84bc70682d5c0a1a42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
|