mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
fix: stream stops and dies on underflow
This commit is contained in:
parent
ab7bf9c709
commit
cf561e78a8
6 changed files with 60 additions and 27 deletions
|
|
@ -121,14 +121,7 @@ function on_hud_open()
|
|||
|
||||
stream = PCMStream(44100, 1, 16)
|
||||
stream:share("test-stream")
|
||||
local bytes = Bytearray(44100 / 8)
|
||||
for i=1,#bytes do
|
||||
local x = math.sin(i * 0.08) * 1 + 0
|
||||
bytes[i] = x
|
||||
end
|
||||
stream:feed(bytes)
|
||||
|
||||
audio.play_stream_2d("test-stream", 2.0, 1.0, "ui")
|
||||
streamid = audio.play_stream_2d("test-stream", 2.0, 1.0, "ui")
|
||||
end
|
||||
|
||||
function on_hud_render()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue