add PCMStream:create_sound method

This commit is contained in:
MihailRis
2025-10-30 22:48:53 +03:00
parent cf561e78a8
commit be2dc1abe5
4 changed files with 42 additions and 0 deletions
+10
View File
@@ -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()