Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicLock

Stop apps from changing your microphone volume on macOS.
One command. No kernel extension, no audio driver, no sudo.

macOS 12+ Apple Silicon and Intel MIT license No dependencies

curl -fsSL https://raw.githubusercontent.com/w1zardz/miclock/master/install.sh | bash
miclock lock --level 80

Your mic gain is now frozen at 80%. Discord, Zoom, Google Meet, Chrome, Teams, Slack, OBS, Skype and Telegram can no longer touch it.


The problem: your mic volume keeps changing by itself

You set your microphone input volume in System Settings → Sound → Input. You join a call. Ten minutes later the slider sits at 3%, or is pinned at 100% and clipping. Nobody can hear you, or everybody hears your fridge.

macOS lets any application write to the input gain of the default microphone, and several of them do it on every call, silently:

App What it does
Zoom "Automatically adjust microphone volume" is on by default and rewrites the system slider
Discord Automatic Gain Control (AGC) rides the input level
Google Meet / Chrome / any WebRTC site WebRTC AGC adjusts hardware gain where the OS allows it
Microsoft Teams, Skype, Slack huddles automatic microphone level adjustment
FaceTime, OBS, Streamlabs, VoiceOver, some drivers occasional level rewrites

macOS has no built-in setting to lock the input volume. That is what MicLock adds.

How MicLock locks the microphone volume

Two independent layers. Use either, or both.

1. Hard lock — a CoreAudio device with no volume control

miclock lock wraps your microphone in a private aggregate device and makes it the system default input. An aggregate device does not expose a volume control at all, so the property an app would write to does not exist. This is not a policy or a preference an app can override — there is physically nothing to set.

$ miclock lock --level 80
✓ gain of "MacBook Pro Microphone" set to 80%
✓ locked — apps now see "MacBook Pro Microphone (MicLock)", a device with no volume control

The gain is set on the real hardware before the wrapper goes up, so you keep the level you chose. Audio quality is untouched: the aggregate passes the same stream through, no resampling, no processing.

2. Watchdog — snap the volume back

miclock watch installs a tiny LaunchAgent that watches the input volume and restores your level within a second of anything moving it. It survives reboots and costs effectively nothing (it polls a single CoreAudio property).

$ miclock watch --level 80
✓ watchdog running — mic volume snaps back to 80% within 2s, starts with your Mac

Belt and braces: miclock lock and miclock watch together. The lock stops apps from changing the gain; the watchdog fixes the level if you ever unlock, swap headsets, or an app gets clever.


Install

curl -fsSL https://raw.githubusercontent.com/w1zardz/miclock/master/install.sh | bash

Requires the Xcode Command Line Tools (xcode-select --install) — the installer compiles a small Swift helper against CoreAudio, so nothing unsigned is downloaded as a binary.

Prefer to read before you run? install.sh is 60 lines.

Manual install:

git clone https://github.com/w1zardz/miclock.git
cd miclock && ./install.sh

Removal is complete and reversible — the aggregate device is destroyed, the LaunchAgent unloaded, your original mic restored:

miclock uninstall

Usage

miclock lock [--level N] [--device UID]   Hard-lock the mic gain (aggregate device)
miclock unlock                            Undo the lock, restore the real microphone
miclock watch [--level N] [--every S]     Background watchdog, restores the level
miclock unwatch                           Stop the watchdog
miclock status                            What is locked, watched, and at what level
miclock devices                           List input devices and their volume controls
miclock set <0-100> [--device UID]        Set input volume once
miclock uninstall                         Remove MicLock completely
$ miclock status
Default input  MacBook Pro Microphone (MicLock)
Volume         no control — apps cannot change it
Lock           ACTIVE on "MacBook Pro Microphone"
Watchdog       running at 80%, every 2s

Lock a specific microphone instead of the current default:

miclock devices                       # copy the uid you want
miclock lock --device AppleUSBAudioEngine:Blue:Yeti:... --level 75

Also turn off in-app AGC

MicLock freezes the hardware gain. Apps can still compress or gate your voice in software, which sounds like the volume moving even though the slider no longer does. Turn that off too:

  • Zoom → Settings → Audio → uncheck Automatically adjust microphone volume
  • Discord → Settings → Voice & Video → Automatic Gain Control off
  • Microsoft Teams → Settings → Devices → Automatically adjust mic sensitivity off
  • OBS → remove any Gain / Compressor / Limiter filter on the mic source
  • Chrome / Google Meet → in-call Settings → Audio, disable noise cancellation if it ducks you

FAQ

Why can apps change my microphone volume on a Mac at all? CoreAudio exposes kAudioDevicePropertyVolumeScalar on input devices as writable to any process holding the device. There is no macOS permission or preference gating it, so any app can set your mic gain without asking.

Does macOS have a setting to lock the input volume? No. Not in System Settings, not in Sound preferences, not via a supported defaults key. The aggregate device approach MicLock uses is the only way to make the gain genuinely unwritable without a custom audio driver.

Does this reduce microphone quality? No. The aggregate device passes the same audio stream through at the same sample rate. It removes a volume control; it does not add processing.

Does it work with USB microphones, audio interfaces, and Bluetooth headsets? Yes — anything that shows up as an input device. Note that Bluetooth headsets switching to the HFP call profile is a separate macOS behaviour, and no gain lock changes it.

Does it work on Apple Silicon (M1/M2/M3/M4) and Intel? Yes, both. The helper builds natively on whatever Mac it is installed on.

Does it need Screen Recording, Microphone, or Accessibility permission? No. MicLock never opens an audio stream — it only reads and writes device properties, so macOS asks for nothing, and MicLock never has access to your audio.

Will it survive a reboot? The watchdog does, via a LaunchAgent. The aggregate device also persists, and MicLock re-selects it. If macOS ever swaps the default input back (new headset plugged in, for example), run miclock lock again.

How do I undo everything? miclock unlock for the device, miclock unwatch for the watchdog, miclock uninstall for both plus the files.

Is there a GUI? Not yet. miclock status is the whole dashboard.

How it works, in detail

  • src/miclock-core.swift — a ~230-line CoreAudio helper: enumerate input devices, read and write kAudioDevicePropertyVolumeScalar on the master and per-channel elements, create and destroy aggregate devices via AudioHardwareCreateAggregateDevice, and set kAudioHardwarePropertyDefaultInputDevice.
  • bin/miclock — the CLI: state in ~/.config/miclock/state, LaunchAgent in ~/Library/LaunchAgents/com.miclock.watchdog.plist.
  • Nothing runs as root. Nothing is installed outside your home directory.

Contributing

Issues and PRs welcome — especially reports of apps that still manage to move the gain, and of audio interfaces whose drivers expose volume in an unusual element layout.

License

MIT — see LICENSE.


Keywords: lock microphone volume macOS · stop apps changing mic volume Mac · mic volume keeps changing Mac · macOS input volume resets by itself · disable automatic gain control macOS · Zoom automatically adjust microphone volume off · Discord changing my mic volume · lock mic gain MacBook · macOS microphone input level jumps to 0 · freeze microphone input volume Mac.

About

Stop apps from changing your microphone volume on macOS. Lock mic input gain so Zoom, Discord, Chrome and Teams can't touch it — one command, no driver, no sudo.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages