maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to control volume/mute? (https://talk.maemo.org/showthread.php?t=28100)

pjscott 2009-04-05 13:59

How to control volume/mute?
 
I'm new to programming this thing; can someone point me towards documentation on how I can change the volume and mute setting from either the command line or Python please? I've hunted through the wiki and googled without any luck.

TrueJournals 2009-04-05 14:07

Re: How to control volume/mute?
 
From the commandline:
Code:

gconftool -t int -s /apps/osso/sound/master_volume -- -100
should mute,
Code:

gconftool -t int -s /apps/osso/sound/master_volume -- (level)
should unmute. In practice, you might want to first get the value of /apps/osso/sound/master_volume, then set it to the opposite of that. The same method could be used to unmute.

Since this is using gconf, writing it in python would be a simple matter of figuring out how to use gconf in python ;) Can't write sample code right now, but I can try later today if you need it.

Matan 2009-04-05 16:39

Re: How to control volume/mute?
 
Theoretically:

Code:

        from gnome import gconf
        gconf_client = gconf.client_get_default ()
        gconf_client.set_int("/apps/osso/sound/master_volume", -gconf_client.get_int("/apps/osso/sound/master_volume"))

In practice it does not work for me. It sets /apps/osso/sound/master_volume to 0.

pjscott 2009-04-05 16:53

Re: How to control volume/mute?
 
The gconftool solution works great for me. I gotta read up on that. Thanks!


All times are GMT. The time now is 16:32.

vBulletin® Version 3.8.8