Skip to content
EcossAIahPublic

About

Menu bar app for picking the default microphone on macOS, with a global shortcut to cycle inputs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Mic Cycle icon

Mic Cycle

A menu bar app for choosing the default microphone on macOS, with a global shortcut to cycle through inputs.

Release License: MIT Platform: macOS 13+

Why

Switching microphones in macOS means opening System Settings > Sound > Input. Mic Cycle puts the list one click away in the menu bar, and Control+Option+M moves to the next input from anywhere. A switch is reported as successful only after macOS reads back the new device.

Install

Homebrew:

brew tap EcossAIah/mic-cycle https://github.com/EcossAIah/mic-cycle
brew trust ecossaiah/mic-cycle
brew install --cask mic-cycle

Or by hand:

  1. Download mic-cycle-<version>.dmg from Releases.
  2. Open it and drag Mic Cycle onto Applications.
  3. Open it. A microphone icon appears in the menu bar. There is no Dock icon.

The release runs on Apple silicon and Intel Macs.

First launch warning

macOS says it "could not verify Mic Cycle is free of malware". This is not a malware finding. Mic Cycle is ad-hoc signed and not notarized, so Gatekeeper blocks the first launch.

  • macOS 15 and later: try to open it once, click Done, then go to System Settings > Privacy & Security and click Open Anyway.
  • macOS 13 and 14: Control-click the app and choose Open.
  • Or remove the download quarantine flag from Terminal: xattr -dr com.apple.quarantine "/Applications/Mic Cycle.app"

Expect this again after each update. If you prefer not to do this, build from source (below).

Update

brew upgrade --cask mic-cycle. If you installed by hand, quit the running copy before replacing it.

Uninstall

  1. Untick Open at Login in the menu, if it is on.
  2. brew uninstall --cask mic-cycle, or quit the app and move it to the Trash.
  3. Optional: brew untap ecossaiah/mic-cycle.

Mic Cycle leaves no other files. If you skipped step 1, remove the leftover entry under System Settings > General > Login Items.

Usage

  • Click the menu bar icon to see the inputs that can be the system default. A checkmark marks the current one. Click another to switch.
  • Press Control+Option+M anywhere, or choose Next Microphone in the menu, to switch to the next input. The order is alphabetical and wraps around.
  • A small panel near the top of the screen confirms each switch, or explains why it failed.
  • The list updates on its own when devices connect, disconnect, or are changed by another app.
  • Open at Login starts Mic Cycle when you log in. Move the app to /Applications first; macOS may ignore it from Downloads.
  • Copy Diagnostics copies the device list, each device's eligibility, and the last error to the clipboard. Paste it into an issue if switching fails.
  • Quit Mic Cycle (Command+Q while the menu is open) exits the app.

Permissions and privacy

  • Mic Cycle changes the system default input device. That is all it changes.
  • It does not record or read audio, so macOS does not ask for microphone access.
  • The global shortcut uses the Carbon hotkey API, which needs no Accessibility permission.
  • It makes no network connections and stores no settings or data on disk.
  • The clipboard is written only when you choose Copy Diagnostics.

Build from source

Requirements: macOS 13 or later and Xcode or the Command Line Tools (xcode-select --install). No Xcode project or third-party packages are used.

git clone https://github.com/EcossAIah/mic-cycle.git
cd mic-cycle
./build-app.sh
open "build/Mic Cycle.app"

build-app.sh compiles App/*.swift with swiftc -O for the host architecture, strips symbols, writes Info.plist, bundles the icon, and ad-hoc signs the result.

./package-release.sh runs the build and writes build/mic-cycle-<version>.zip with its SHA-256 checksum. That zip is what Releases publishes.

Run the tests:

./test-core-audio.sh --logic-only   # no hardware needed, changes nothing
./test-core-audio.sh                # also switches real inputs, then restores the original

See docs/TESTING.md for what each test covers.

To regenerate the icon after editing Tools/generate-icon.swift:

swift Tools/generate-icon.swift

How it works

  • CoreAudioClient talks to the Core Audio HAL. An input is listed when it is alive, has input channels, and reports kAudioDevicePropertyDeviceCanBeDefaultDevice for the input scope. Devices that cannot be the default are hidden.
  • Switching sets kAudioHardwarePropertyDefaultInputDevice, then polls the value every 50 ms for up to two seconds. The switch counts as done only when the readback matches. An accepted write alone is never shown as success.
  • AudioDeviceStore registers property listeners on the device list, the default input, and each device's name, liveness, eligibility, and stream configuration, so the menu stays current.
  • GlobalHotKey registers Control+Option+M with RegisterEventHotKey.
  • The UI is a SwiftUI MenuBarExtra. LSUIElement keeps the app out of the Dock.

Command-line extra

Extras/NextMicrophone.swift is the small CLI this app grew from. It lists inputs (--list) or switches to the next one, without the app's eligibility checks or readback.

mkdir -p build/module-cache
xcrun swiftc -module-cache-path build/module-cache -O -framework CoreAudio \
  Extras/NextMicrophone.swift -o build/next-microphone

Limitations

  • The shortcut is fixed to Control+Option+M. If another app holds it, the menu shows an error and the device list still works. Free the shortcut and restart Mic Cycle.
  • Apps that pick a specific microphone in their own settings ignore the system default.
  • Not notarized.
  • Live switching and hotkey delivery are not covered by CI; they need real audio hardware.

License

MIT

About

Menu bar app for picking the default microphone on macOS, with a global shortcut to cycle inputs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages