fix pcm examples to comply with current code base (#1720)
This commit is contained in:
parent
0a503587ee
commit
46dc9eaeb3
|
@ -27,8 +27,8 @@ file.open("jump_8k.u8", "r")
|
|||
|
||||
drv = pcm.new(pcm.SD, 1)
|
||||
|
||||
-- fetch data in chunks of LUA_BUFFERSIZE (1024) from file
|
||||
drv:on("data", file.read)
|
||||
-- fetch data in chunks of FILE_READ_CHUNK (1024) from file
|
||||
drv:on("data", function(drv) return file.read() end)
|
||||
|
||||
-- get called back when all samples were read from the file
|
||||
drv:on("drained", cb_drained)
|
||||
|
|
|
@ -119,7 +119,7 @@ function M.play(rate, ip, port, path, cb)
|
|||
_path = path
|
||||
_play_cb = cb
|
||||
|
||||
_conn = net.createConnection(net.TCP, false)
|
||||
_conn = net.createConnection(net.TCP, 0)
|
||||
_conn:on("receive", data_received)
|
||||
_conn:on("disconnection", cb_disconnected)
|
||||
_conn:connect(port, ip, cb_connected)
|
||||
|
|
Loading…
Reference in New Issue