Get and Set system parameters in macro

Is it possible to access system parameters from LO basic macro? Specifically I want to Get and Set the sound level from within an impress file. This would be equivalent to the system command amixer.

https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1media_1_1XPlayer.html
.
.
https://forum.openoffice.org/en/forum/viewtopic.php?t=57699

1 Like

Thanks @Zizi64 . Looks very helpful. I’ll try some of this tomorrow!

Thanks @Zizi64. Perhaps I am missing something here, but Following @hanya’s code, when this line executes:

oPlayer1 = oSounMgr.createPlayer(sFile)

nothing happens. Is this line supposed to start a sound playing? In fact I want to connect to the existing player and reduce its volume, not create a new one.

Typically stupid of me. I had not included the start() statement. This is working now.
Many thanks @Zizi64 .

So use the »commandline«

from subprocess import run

def volume_down_10(*_):
    run( ["amixer", "-q", "-D", "pulse",
          "sset", "Master", "10%-"] )