update audio lib
This commit is contained in:
parent
4f96ec47cd
commit
96bc395561
@ -29,7 +29,7 @@ local initialized = false
|
|||||||
function on_open()
|
function on_open()
|
||||||
if not initialized then
|
if not initialized then
|
||||||
initialized = true
|
initialized = true
|
||||||
local token = audio.input.__get_core_token()
|
local token = core.get_core_token()
|
||||||
document.root:add("<container id='tm' />")
|
document.root:add("<container id='tm' />")
|
||||||
local prev_amplitude = 0.0
|
local prev_amplitude = 0.0
|
||||||
document.tm:setInterval(16, function()
|
document.tm:setInterval(16, function()
|
||||||
@ -54,16 +54,16 @@ function on_open()
|
|||||||
create_setting("audio.volume-music", "Music", 0.01)
|
create_setting("audio.volume-music", "Music", 0.01)
|
||||||
document.root:add("<label context='settings'>@Microphone</label>")
|
document.root:add("<label context='settings'>@Microphone</label>")
|
||||||
document.root:add("<select id='input_device_select' "..
|
document.root:add("<select id='input_device_select' "..
|
||||||
"onselect='function(opt) audio.set_input_device(opt) end'/>")
|
"onselect='function(opt) audio.__set_input_device(opt) end'/>")
|
||||||
document.root:add("<container id='input_volume_outer' color='#000000' size='4'>"
|
document.root:add("<container id='input_volume_outer' color='#000000' size='4'>"
|
||||||
.."<container id='input_volume_inner' color='#00FF00FF' pos='1' size='2'/>"
|
.."<container id='input_volume_inner' color='#00FF00FF' pos='1' size='2'/>"
|
||||||
.."</container>")
|
.."</container>")
|
||||||
local selectbox = document.input_device_select
|
local selectbox = document.input_device_select
|
||||||
local devices = {}
|
local devices = {}
|
||||||
local names = audio.get_input_devices_names()
|
local names = audio.__get_input_devices_names()
|
||||||
for i, name in ipairs(names) do
|
for i, name in ipairs(names) do
|
||||||
table.insert(devices, {value=name, text=name})
|
table.insert(devices, {value=name, text=name})
|
||||||
end
|
end
|
||||||
selectbox.options = devices
|
selectbox.options = devices
|
||||||
selectbox.value = audio.get_input_info().device_specifier
|
selectbox.value = audio.__get_input_info().device_specifier
|
||||||
end
|
end
|
||||||
|
|||||||
@ -445,6 +445,7 @@ local __post_runnables = {}
|
|||||||
|
|
||||||
local fn_audio_reset_fetch_buffer = audio.__reset_fetch_buffer
|
local fn_audio_reset_fetch_buffer = audio.__reset_fetch_buffer
|
||||||
audio.__reset_fetch_buffer = nil
|
audio.__reset_fetch_buffer = nil
|
||||||
|
core.get_core_token = audio.input.__get_core_token
|
||||||
|
|
||||||
function __process_post_runnables()
|
function __process_post_runnables()
|
||||||
if #__post_runnables then
|
if #__post_runnables then
|
||||||
|
|||||||
@ -480,9 +480,9 @@ const luaL_Reg audiolib[] = {
|
|||||||
{"count_speakers", lua::wrap<l_audio_count_speakers>},
|
{"count_speakers", lua::wrap<l_audio_count_speakers>},
|
||||||
{"count_streams", lua::wrap<l_audio_count_streams>},
|
{"count_streams", lua::wrap<l_audio_count_streams>},
|
||||||
{"__fetch_input", lua::wrap<l_audio_fetch_input>},
|
{"__fetch_input", lua::wrap<l_audio_fetch_input>},
|
||||||
{"get_input_devices_names", lua::wrap<l_audio_get_input_devices_names>},
|
{"__get_input_devices_names", lua::wrap<l_audio_get_input_devices_names>},
|
||||||
{"get_output_devices_names", lua::wrap<l_audio_get_output_devices_names>},
|
{"__get_output_devices_names", lua::wrap<l_audio_get_output_devices_names>},
|
||||||
{"set_input_device", lua::wrap<l_audio_set_input_device>},
|
{"__set_input_device", lua::wrap<l_audio_set_input_device>},
|
||||||
{"get_input_info", lua::wrap<l_audio_get_input_info>},
|
{"__get_input_info", lua::wrap<l_audio_get_input_info>},
|
||||||
{nullptr, nullptr}
|
{nullptr, nullptr}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user