[SailfishDevel] How to change global volume

Juho Hämäläinen juho.hamalainen at tieto.com
Mon Jan 12 09:02:08 UTC 2015


On 25.12.2014 14:05, qt_junkie wrote:
> Hi,
>
> does anyone know how can I programmatically change the global volume of
> the phone?
>
> There is Nemo D-Bus interface but it seems not to be used in
> Jolla: https://wiki.merproject.org/wiki/Nemo/Audio/MainVolume
>
> Does anyone know the proper way to do it?

Hello,

MainVolume actually IS in use in Jolla. But, as mentioned on that page 
the D-Bus API is not in session/system-bus, but in PulseAudio 
peer-to-peer bus (PA implementation detail). So in order to use the 
MainVolume API, you'll need to connect to the PulseAudio peer-to-peer 
bus first. There are links on that page that explain how it is done.

Here is simple example in Python how to use MainVolume: 
https://github.com/jusa/pulseaudio-utils/blob/master/mainvolume-volume.py


-- 
juho


More information about the Devel mailing list