Last active
January 18, 2026 11:48
-
-
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).
This file contains hidden or 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
| #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 | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I removed the "enabled/disabled" indicator because it minimized fullscreen games/programs.