-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample01.lua
More file actions
32 lines (25 loc) · 1.12 KB
/
Copy pathexample01.lua
File metadata and controls
32 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
----------------------------------------------------------------------------------------------------
--[[
This example lists all compiled [RtAudio] APIs and for each API it displays infos for
all available devices.
--]]
----------------------------------------------------------------------------------------------------
local inspect = require("inspect") -- https://luarocks.org/modules/kikito/inspect
local lrtaudio = require("lrtaudio")
print("---------------------------------------------------------------------------------------------")
local apis = lrtaudio.getCompiledApi()
print("Compiled APIS:", inspect(apis))
for _, api in ipairs(apis) do
print("-----------------------------------------------------------------------------------------")
print("API: ", api)
local ok, rslt = pcall(function()
local controller = lrtaudio.new(api)
return controller:getDeviceInfo()
end)
if ok then
print("DeviceInfo", inspect(rslt))
else
print("Error", rslt)
end
end
print("---------------------------------------------------------------------------------------------")