Results 1 to 2 of 2

Thread: (un)mute master

  1. #1
    Join Date
    Mar 2012
    Beans
    10

    (un)mute master

    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()

  2. #2
    Join Date
    Mar 2012
    Beans
    10

    Re: (un)mute master

    Has everyone tested the script ?
    Does it work on your system ?
    I use Untuntu 12.04 LTS Sound Card: Playback: Built-in-Audio Analog Stereo(Pulse Audo Mixer)

    bye

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •