add internal/audio_input module

This commit is contained in:
MihailRis
2025-10-31 23:30:29 +03:00
parent 284f24433c
commit fe8e4ba7b4
5 changed files with 39 additions and 4 deletions
+8 -2
View File
@@ -134,6 +134,10 @@ function on_hud_open()
audio.play_sound_2d("test-sound", 2.0, 1.0, "ui")
end
audio.input.request_open(function(token)
input_access_token = token
end)
function on_hud_render()
if hud.hand_controller then
hud.hand_controller()
@@ -141,6 +145,8 @@ function on_hud_render()
update_hand()
end
local bytes = audio.fetch_input()
stream:feed(bytes)
if input_access_token then
local bytes = audio.fetch_input(input_access_token)
stream:feed(bytes)
end
end
+1
View File
@@ -179,6 +179,7 @@ end
require "core:internal/maths_inline"
require "core:internal/debugging"
require "core:internal/audio_input"
asserts = require "core:internal/asserts"
events = require "core:internal/events"
+1 -1
View File
@@ -2,7 +2,7 @@ local _ffi = ffi
local _debug_getinfo = debug.getinfo
function crc32(bytes, chksum)
local chksum = chksum or 0
chksum = chksum or 0
local length = #bytes
if type(bytes) == "table" then