Hello Users,
I have written this little test script to mute or unmute my Sound it works for muting.
But not for unmuting.
The script checks EITHER sound is muted and if so it unmutes OR sound is unmuted then it mutes
The line alsa.Mixer('Master').setmute(0) should unmute, but nothing happens
I'm using Ubuntu with fluxbox as desktop environment
What can I do ?
here is the script
Code:
#!/usr/bin/python
import alsaaudio as alsa
def isMuted():
if alsa.Mixer('Master').getmute()[0] == 1:
#self.volume_icon.set_from_file(AUDIO_ICON)
return True
else:
#self.volume_icon.set_from_file(AUDIO_ICON_MUTED)
return False
def mute():
alsa.Mixer('Master').setmute(1)
#setmute(on/off,channel)
def unmute():
alsa.Mixer('Master').setmute(0)
if __name__ == "__main__":
if isMuted():
print "muted we unmute"
unmute()
else:
print "not muted we mute"
mute()