forked from hkc/cc-stuff
You just call it apparently
This commit is contained in:
parent
a396ab67ca
commit
cdaa2c210d
|
@ -27,7 +27,7 @@ for i = 1, buffer_size do
|
||||||
buffer[i] = 0
|
buffer[i] = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local decoder = dfpwm.make_decoder()
|
local decode = dfpwm.make_decoder()
|
||||||
while true do
|
while true do
|
||||||
local chunk = req.read(buffer_size)
|
local chunk = req.read(buffer_size)
|
||||||
if not chunk then
|
if not chunk then
|
||||||
|
@ -39,7 +39,7 @@ while true do
|
||||||
-- buffer[i] = string.byte(chunk, i) - 128
|
-- buffer[i] = string.byte(chunk, i) - 128
|
||||||
--end
|
--end
|
||||||
|
|
||||||
local buffer = decoder.decode(chunk)
|
local buffer = decode(chunk)
|
||||||
|
|
||||||
while not speaker.playAudio(buffer) do
|
while not speaker.playAudio(buffer) do
|
||||||
os.pullEvent("speaker_audio_empty")
|
os.pullEvent("speaker_audio_empty")
|
||||||
|
|
Loading…
Reference in New Issue