mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add PCMStream:create_sound method
This commit is contained in:
parent
cf561e78a8
commit
be2dc1abe5
4 changed files with 42 additions and 0 deletions
|
|
@ -122,6 +122,16 @@ function on_hud_open()
|
|||
stream = PCMStream(44100, 1, 16)
|
||||
stream:share("test-stream")
|
||||
streamid = audio.play_stream_2d("test-stream", 2.0, 1.0, "ui")
|
||||
|
||||
|
||||
s = PCMStream(44100, 1, 8)
|
||||
local buffer = Bytearray(44100)
|
||||
for i=1, #buffer do
|
||||
buffer[i] = math.random(1, 8)
|
||||
end
|
||||
s:feed(buffer)
|
||||
s:create_sound("test-sound")
|
||||
audio.play_sound_2d("test-sound", 2.0, 1.0, "ui")
|
||||
end
|
||||
|
||||
function on_hud_render()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue