add internal/audio_input module
This commit is contained in:
+8
-2
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user