Skip to main content

Automatic microphone volume control for macOS calls and meetings

Project description

mic-control

CI Release PyPI License: MIT Python 3.12+ Platform Poetry

Ruff mypy

Automatic microphone volume control for macOS calls and meetings.

What It Does

  • Monitors and maintains mic input level during calls
  • Two-tier call detection: quick checks between full audio sampling passes
  • Rich terminal output with live status
  • Low resource usage, runs in background
  • Native macOS integration via osascript

Quick Start

Install mic-control

Install with pipx (recommended):

pipx install mic-control

Or with pip in a virtual environment:

pip install mic-control

Tip: pipx is recommended for global CLI tools as it provides isolated environments.

Or with Poetry (for development):

git clone https://github.com/bulletinmybeard/mic-control.git
cd mic-control
poetry install

Run mic-control

# Start with default settings
mic-control

# Custom target volume
mic-control --target-volume 70

# Use a specific input device (index or name)
mic-control --input-device 1

# Verbose debug output
mic-control --verbose

# Run in background
mic-control &

CLI Commands

Command Description
mic-control Start with default settings (80% volume)
mic-control --target-volume 70 Set custom target volume (0-100)
mic-control --active-interval 5 Seconds between checks during calls (>= 1)
mic-control --idle-interval 15 Seconds between checks when idle (>= 1)
mic-control --call-interval 30 Seconds between full detection passes (>= 1)
mic-control --input-device DEVICE Input device index or name for detection
mic-control --log-path PATH Custom log file location
mic-control --verbose Enable debug output
mic-control --version Show version

Example Output

╭──────────────────────────────────────────╮
│        mic-control v2.1.0                │
│                                          │
│  Target Volume: 80                       │
│  Active Interval: 5s                     │
│  Idle Interval: 15s                      │
│  Call Interval: 30s                      │
│  Input Device: system default            │
│  Log Path: /Users/.../.mic-control/...   │
╰──────────────────────────────────────────╯

⠋ Detecting call activity...
-> Not in call (detection took 5.2s)

⠋ Confirming call activity...
-> In call (detection took 5.1s)
ℹ Adjusting volume: 50 -> 80

^C
Shutting down gracefully...
Microphone controller stopped

How Call Detection Works

mic-control uses a two-tier strategy:

  1. Full detection: runs every --call-interval seconds (default 30s). It records five 1-second audio samples and treats persistent activity as a call.
  2. Quick checks: run between full passes. When idle, a short sample can trigger a faster confirmation pass. When in a call, consecutive inactive quick checks end call mode without waiting for the next full pass.

This keeps volume adjustments responsive while limiting CPU and microphone usage.

Limitations

  • macOS only: volume control relies on osascript.
  • Audio-based detection: music, notifications, or background noise can be mistaken for a call. Quiet calls may be missed.
  • Default input device: unless --input-device is set, detection uses the system default microphone. Meeting apps that use a different device may not be detected reliably.
  • Microphone permission: macOS must grant microphone access. Permission or device errors are logged and treated as "no activity" during quick checks.

List available input devices from Python:

poetry run python -c "import sounddevice as sd; print(sd.query_devices())"

Requirements

  • macOS 10.0+
  • Python 3.12+

Troubleshooting

If the script can't access your mic

  • Check the mic permissions in your System Preferences
  • Make sure no other app or script is exclusively using the mic
  • Try --input-device with the device your meeting app uses

If volume adjustments don't work

  • Verify you have permission to run osascript

For logging issues

  • Ensure the log file location has the correct write permissions
  • Check available disk space

Links

License

MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mic_control-2.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mic_control-2.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file mic_control-2.1.0.tar.gz.

File metadata

  • Download URL: mic_control-2.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.10 Darwin/24.6.0

File hashes

Hashes for mic_control-2.1.0.tar.gz
Algorithm Hash digest
SHA256 c63581e3cafa1d5b0e0c0a121d7ce4f419963644e3aed50f5b38b809362d1db8
MD5 3b1b23855ed17585d9537741cd36f428
BLAKE2b-256 bebae5286c74c214b3f71994b3055797902cc09eb4b329bd577ebd634e9702d7

See more details on using hashes here.

File details

Details for the file mic_control-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: mic_control-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.10 Darwin/24.6.0

File hashes

Hashes for mic_control-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f75a5364ff39a869ffc1f9677af56f4eafb6ac3dd9fde4fe66228e20756197fb
MD5 632b220403414076f5e466fcab33c140
BLAKE2b-256 2876f2514d532ca487d838e0d6b80ca36c3e6b03dd324b66f3f1bc1da5fa0042

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page