Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
46dc9eae
Commit
46dc9eae
authored
Jan 11, 2017
by
Arnim Läuger
Committed by
Marcel Stör
Jan 11, 2017
Browse files
fix pcm examples to comply with current code base (#1720)
parent
0a503587
Changes
2
Hide whitespace changes
Inline
Side-by-side
lua_examples/pcm/play_file.lua
View file @
46dc9eae
...
@@ -27,8 +27,8 @@ file.open("jump_8k.u8", "r")
...
@@ -27,8 +27,8 @@ file.open("jump_8k.u8", "r")
drv
=
pcm
.
new
(
pcm
.
SD
,
1
)
drv
=
pcm
.
new
(
pcm
.
SD
,
1
)
-- fetch data in chunks of
LUA_BUFFERSIZE
(1024) from file
-- fetch data in chunks of
FILE_READ_CHUNK
(1024) from file
drv
:
on
(
"data"
,
file
.
read
)
drv
:
on
(
"data"
,
function
(
drv
)
return
file
.
read
()
end
)
-- get called back when all samples were read from the file
-- get called back when all samples were read from the file
drv
:
on
(
"drained"
,
cb_drained
)
drv
:
on
(
"drained"
,
cb_drained
)
...
...
lua_examples/pcm/play_network.lua
View file @
46dc9eae
...
@@ -119,7 +119,7 @@ function M.play(rate, ip, port, path, cb)
...
@@ -119,7 +119,7 @@ function M.play(rate, ip, port, path, cb)
_path
=
path
_path
=
path
_play_cb
=
cb
_play_cb
=
cb
_conn
=
net
.
createConnection
(
net
.
TCP
,
false
)
_conn
=
net
.
createConnection
(
net
.
TCP
,
0
)
_conn
:
on
(
"receive"
,
data_received
)
_conn
:
on
(
"receive"
,
data_received
)
_conn
:
on
(
"disconnection"
,
cb_disconnected
)
_conn
:
on
(
"disconnection"
,
cb_disconnected
)
_conn
:
connect
(
port
,
ip
,
cb_connected
)
_conn
:
connect
(
port
,
ip
,
cb_connected
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment