Hotkey to Mute Mic on Mac OS X?

Is there a hotkey I can use or configure to mute the mic on a 13" MacBook Pro (MPB)?

I would prefer an icon or notification to confirm that it is set (even if I need to toggle the option).


Solution 1:

You can simply Alt-Click on Sound/Speaker icon in the menubar, then select Line In as Input Device to mute the mic.

When you want it back, just select Internal microphone again.

lineine

Solution 2:

Here are instructions to save a script as a service in Automator and assign a hotkey to it in System Preferences.

And here's the script to mute / unmute with a display notification (extended from tkneis's answer).

on run {input, parameters}

    set inputVolume to input volume of (get volume settings)
    if inputVolume = 0 then
        set inputVolume to 100
        set displayNotification to "Microphone Unmuted"
    else
        set inputVolume to 0
        set displayNotification to "Microphone Muted"
    end if
    set volume input volume inputVolume

    display notification displayNotification
    delay 1

    return input
end run

Solution 3:

This works best, especially if you want to assign this script to a Hotkey:

set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
    set inputVolume to 100
else
    set inputVolume to 0
end if
set volume input volume inputVolume

This method doesn't require you to activate the System Preference GUI, or to go through the volume settings of whichever app is active. Instead it is getting the system's volume settings, and then checking to see if the input volume is already 0--if it is it will set the input volume to 100, and if it isn't it will mute the input volume.

Works like a charm.

Solution 4:

This can also be accomplished with a simple AppleScript:

tell application "System Events" to set volume input volume 0

Reverse the process:

tell application "System Events" to set volume input volume 100

EDIT

By the way, Soundsource is a free application that gives you nice easy sliders to toggle Speaker/Microphone levels from the menu bar, without the need for pesky extra dialogs.

Solution 5:

Finally I got a perfect solution to mute my mac,

What I did was to install this MuteMyMic , Just to know when having visual representation if the microphone is muted or not all the time.

Then I found this Shush! workflow for Alfred , and then to have an easier access I added a shortcut to rise this Mute/Unmute action, then to turn mic on / off is easier as raising the shortcut, and I know if it's on or off by the MuteMyMic icon on the bar.

I hope this helps anyone else. Enjoy