Keep your Mac's sound input on the mic you picked.
macOS loves switching your input whenever you connect AirPods, plug in headphones, or attach a webcam.
InputLock sits in your menu bar and switches it straight back.
Paste this into Terminal:
curl -fsSL https://raw.githubusercontent.com/anandrajaram21/InputLock/main/install.sh | bashThat's it. InputLock is installed in /Applications, opened, and you'll see a 🎙️ in your menu bar.
Other ways to install
brew tap anandrajaram21/inputlock https://github.com/anandrajaram21/InputLock
brew install --cask inputlock- Download InputLock.zip, unzip it, and drag
InputLock.appinto/Applications. - Open it. macOS will warn that the app isn't from an identified developer (see why).
- Go to System Settings → Privacy & Security, scroll down, and click Open Anyway.
git clone https://github.com/anandrajaram21/InputLock.git
cd InputLock && ./scripts/build-app.sh
cp -R build/InputLock.app /Applications/- Click the mic icon in your menu bar.
- Pick the input device you want to keep.
- Done. Whenever something switches your input, InputLock switches it back.
Keep Sound Input On
✓ USB Microphone (current)
MacBook Air Microphone
AirPods Pro
───────────────────────
✓ Lock Enabled
Launch at Login
───────────────────────
Quit InputLock ⌘Q
| Menu bar icon | Meaning |
|---|---|
| 🎙️ solid mic | Locking your chosen device |
| 🚫 mic with a slash | Not locking (no device picked, or lock turned off) |
Tip
Turn on Launch at Login so InputLock is always running in the background.
- 🔒 Instant switch-back: reacts the moment the input changes, with no polling
- 🔌 Survives unplugging: remembers your device and locks it again when you reconnect it
- 🪶 Tiny and quiet: menu bar only, no Dock icon, ~0% CPU
- 🙈 No permissions needed: never listens to your mic and makes no network requests
- 🧑💻 ~200 lines of Swift: easy to read and audit
Does it record or access my microphone?
No. It only changes which device is the system default input, using the same CoreAudio setting as System Settings → Sound → Input. It never opens an audio stream, so macOS never asks for microphone permission.
What happens if my chosen mic is unplugged?
InputLock leaves your input alone and shows the device as (disconnected) in the menu. When you plug it back in, it becomes the input again automatically.
How do I stop locking temporarily?
Uncheck Lock Enabled in the menu, or click the checked device again to clear your choice.
Why does macOS warn about the app?
Removing that warning requires a paid Apple Developer membership ($99/year) for signing and notarization. InputLock isn't notarized yet. The one-line installer and Homebrew skip the warning because they download the app directly. The source code is all here if you'd like to check it or build it yourself.
Quit InputLock from its menu, then:
rm -rf /Applications/InputLock.app
defaults delete io.github.inputlockInstalled with Homebrew? Use brew uninstall --cask --zap inputlock instead.
InputLock registers CoreAudio listeners on kAudioHardwarePropertyDefaultInputDevice and
kAudioHardwarePropertyDevices. When either changes and your chosen device is connected but isn't the
default input, InputLock sets it as the default again. Devices are stored by their unique ID, so they
stay recognized across reconnects and reboots.
| File | What it does |
|---|---|
AudioDevices.swift |
Lists input devices, gets and sets the default input, and watches for changes |
AppDelegate.swift |
Menu bar UI and switch-back logic |
build-app.sh |
Builds a universal .app bundle |
MIT. Contributions are welcome!