Created
April 16, 2020 06:19
-
-
Save Arty2/ce943769f33f307375bfcbe75b0300b8 to your computer and use it in GitHub Desktop.
An AutoHotKey script to mute/unmute all microphones on a system level. Works with Windows 10.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; An AutoHotKey script to mute/unmute all microphones on a system level. Toggle with Caps Lock. | |
; Emits a single beep on mute, double on unmute. Tray icon changes accordingly. | |
; Requires https://www.nirsoft.net/articles/mute_microphone_command_line.html | |
; Note: SoundSet doesn't work as intented | |
; TODO: detect tap and hold to speak, based on https://github.com/YoYo-Pete/AutoHotKeys/blob/master/PushToTalk.ahk | |
; https://www.howtogeek.com/446418/how-to-use-caps-lock-as-a-modifier-key-on-windows/ | |
; also https://stackoverflow.com/questions/1794258/detect-a-double-key-press-in-autohotkey | |
$Capslock:: | |
toggle := !toggle | |
If toggle { | |
Sleep 500 ; mute with a small delay to avoid cut-off words | |
SoundBeep, 500 | |
Menu, Tray, Tip, Mic Muted | |
Menu, Tray, Icon, SndVol.exe, 3, 1 | |
Run "C:\portable\SoundVolumeView\SoundVolumeView.exe" /Mute "DefaultCaptureDevice" | |
} | |
else { | |
SoundBeep, 900 | |
SoundBeep, 900 | |
Menu, Tray, Tip, Mic Active | |
Menu, Tray, Icon, SndVol.exe, 2, 1 | |
Run "C:\portable\SoundVolumeView\SoundVolumeView.exe" /Unmute "DefaultCaptureDevice" | |
} | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although useful in a pinch, this script is not very reliable. On computers with multiple microphone devices, it only motes the default and going through all available devices doesn't seem easy or effective.