Commit c5360887 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

examples: add example script to get the default sink's volume

parent 155ad322
Pipeline #300771 passed with stages
in 1 minute and 39 seconds
-- WirePlumber
-- Copyright © 2021 Collabora Ltd.
-- @author George Kiagiadakis <>
-- SPDX-License-Identifier: MIT
-- Load the necessary wireplumber api modules
Core.require_api("default-nodes", "mixer", function(...)
local default_nodes, mixer = ...
-- configure volumes to be printed in the cubic scale
-- this is also what the pulseaudio API shows
mixer.scale = "cubic"
local id = default_nodes:call("get-default-node", "Audio/Sink")
local volume = mixer:call("get-volume", id)
-- dump everything
-- or maybe just the volume...
-- print(volume.volume)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment