Debian Codegraph @

tests/examples/get-default-sink-volume.lua

raw
1 #!/usr/bin/wpexec
2 --
3 -- WirePlumber
4 --
5 -- Copyright © 2021 Collabora Ltd.
6 -- @author George Kiagiadakis <[email protected]>
7 --
8 -- SPDX-License-Identifier: MIT
9 --
10
11 -- Load the necessary wireplumber api modules
12 Core.require_api("default-nodes", "mixer", function(...)
13 local default_nodes, mixer = ...
14
15 -- configure volumes to be printed in the cubic scale
16 -- this is also what the pulseaudio API shows
17 mixer.scale = "cubic"
18
19 local id = default_nodes:call("get-default-node", "Audio/Sink")
20 local volume = mixer:call("get-volume", id)
21
22 -- dump everything
23 Debug.dump_table(volume)
24
25 -- or maybe just the volume...
26 -- print(volume.volume)
27
28 Core.quit()
29 end)