Przeglądaj źródła

fix pcm examples to comply with current code base (#1720)

Arnim Läuger 7 lat temu
rodzic
commit
46dc9eaeb3

+ 2 - 2
lua_examples/pcm/play_file.lua

@@ -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)

+ 1 - 1
lua_examples/pcm/play_network.lua

@@ -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)