Skip to content

Instantly share code, notes, and snippets.

@iiiGerardoiii
Last active January 18, 2026 11:48
Show Gist options
  • Select an option

  • Save iiiGerardoiii/8394e619a5c546a415f2a06d63bfa39d to your computer and use it in GitHub Desktop.

Select an option

Save iiiGerardoiii/8394e619a5c546a415f2a06d63bfa39d to your computer and use it in GitHub Desktop.
AHK script that mutes your default microphone when you mute your speakers or have volume at zero. (RIP PowerToys' Conference Mute).
#Requires AutoHotkey v2.0
#SingleInstance Force
; Monitor the system for volume changes every 250ms
SetTimer(SyncOnlyDefaultDevices, 250)
SyncOnlyDefaultDevices() {
static lastMuteState := -1
try {
; 1. Get mute state of ONLY the system's current Default Playback device
currentMute := SoundGetMute()
; 2. Only act if the state has changed
if (currentMute != lastMuteState) {
; 3. Find the Default Recording device ID and apply the mute
; We scan specifically for the Master component of recording devices
Loop {
try {
; Get the name of the recording device at this index
devName := SoundGetName( , A_Index)
; Check if this device is categorized as a recording/capture device
; by testing for the "Capture" component
try {
SoundSetMute(currentMute, "Capture", A_Index)
; Once we successfully mute the first 'Capture' device (Default), we stop
break
}
} catch {
if (A_Index > 10) ; Safety stop after 10 devices
break
}
}
lastMuteState := currentMute
}
}
}
@iiiGerardoiii
Copy link
Author

I removed the "enabled/disabled" indicator because it minimized fullscreen games/programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment