Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

During voice conversations in Skype/Gmail/etc. I would like to mute/unmute the microphone without having to go through all these steps each time:

  • Sound indicator
    • Sound preferences
      • Select Input
        • Mute/unmute the microphone


I'm looking for either:

  • an application that can do this from the commandline,
  • a way I can assign a keyboard shortcut that can mute/unmute the microphone
share|improve this question
1  
If you use Empathy for voice chat, it has a mute button built-in (that works with Google Talk at least, Skype isn't supported yet). –  JanC Nov 8 '10 at 14:56
    
I'm looking for something that can be made to run through a shortcut, similar to the main volume mute/unmute laptop toggle button. –  Lucian Adrian Grijincu Nov 8 '10 at 16:03

4 Answers 4

You can mute the microphone with

amixer set Capture nocap

and unmute the microphone with

amixer set Capture cap
share|improve this answer
    
that worked great with raspberry pi, except you substitute Mic for Capture –  WhiskerBiscuit Apr 24 at 6:41
up vote 10 down vote accepted

Go to

System -> Preferences -> Keyboard shortcuts

Adding keyboard shortcuts

Click on Add

Add a command to toggle the microphone

Fill in

Toggle microphone

amixer set Capture toggle

For usb webcams you need to chose device (-c 1) :

amixer -c 1 sset Mic toggle

Click Apply and then associate a new key with this command (e.g. the Pause/Break key).

share|improve this answer
    
Works this with recent releases? Thank you. –  Diego V Apr 9 '13 at 19:23
1  
It does work; thanks to Lucian. I have an "Audio mute" key on my laptop, I mapped it to shift+Audio mute, which is very easy to remember :) –  Pierre-Antoine Apr 15 '13 at 15:55
    
The command amixer set Mic toggle (not Capture) works for me in terminal but any assigned keyboard shortcut doesn't actually seem to run. I've tried ctrl+Audio Mute but also ctrl+M (captured by keyboard key presses) –  uosɐſ Jan 15 at 15:42

You can mute with:

/usr/bin/amixer -q -c 0 sset 'Master',0 mute

Unmute:

/usr/bin/amixer -q -c 0 sset 'Master',0 unmute

You just need to replace 'Master' with the appropriate mixer name, on the terminal use "amixer" to get a list of mixer devices.

About setting the keyboard shortcut check the answers for How can I find which command is bound to a given keyboard shortcut?

share|improve this answer
    
These mute the sound from my speakers, not the microphone, but thanks. –  Lucian Adrian Grijincu Nov 8 '10 at 15:29
    
You just need to replace 'Master' with the appropriate mixer name, on the terminal use "amixer" to get a list of mixer devices. –  João Pinto Nov 8 '10 at 15:36
    
This seems to work: # amixer set Capture toggle –  Lucian Adrian Grijincu Nov 8 '10 at 15:53
    
Can you edit your response (I don't have the necessary karma) to include this answer so I'll accept it? –  Lucian Adrian Grijincu Nov 8 '10 at 16:00

pacmd is the command line interface to PulseAudio (the sound subsystem used in recent releases). I don't know what the exact command is you'd need but I think you'd want to play with the set-sink-input-mute function.

pacmd is interactive when run without instructions so you have a good opportunity to play around with it and convert that into a one-line function for toggling mute.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.