sqp / pulseaudio

pulseaudio dbus client for go
ISC License
36 stars 7 forks source link

Question: Get Sink Inputs #4

Open oliveirafilipe opened 4 years ago

oliveirafilipe commented 4 years ago

Hi, i'm starting to think in build a sound controller that turns down a sink input volume when another, with high priority, is emitting sound.

I just started today to gather data and options to built it.

I think that i already realized that Pulseaudio's Sink Input is what I need to achieve this.

I saw your package and couldn't realize if it can list Sink Inputs. So, can I use your package to get Sink Inputs and manage their volume?

Thank you!

humaidq commented 3 years ago

From what it seems, the PlaybackStreams property is synonymous with sink inputs. Furthermore, you can see what properties are available at PulseAudio's D-Bus documentation (see [1]).

An example is provided with PlaybackStreams, including how to get other properties. https://github.com/sqp/pulseaudio/blob/29ac6bfa231cb9de7f576c671c095fd8161d52e5/example_test.go#L147

Here is an example on how to set properties. https://github.com/sqp/pulseaudio/blob/29ac6bfa231cb9de7f576c671c095fd8161d52e5/example_test.go#L189

[1]\: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/DBus/#propertylists