Skip to content

minkyu97/sound-control-mac

Repository files navigation

sound-control-mac

Menu bar macOS app for per-app audio control with persistent app profiles.

Implemented

  • SwiftUI menu bar UI (MenuBarExtra) with:
    • DEVICE section:
      • Output/Input tabs
      • Per-device row controls (default-device radio, icon, name, slider, typed percentage input)
      • Per-device hardware volume control when supported, with DDC fallback for external display audio outputs
      • Per-device 10-band EQ for output devices (32Hz to 16kHz, low-to-high left-to-right; per-app EQ overrides per-device EQ)
    • APPS section:
      • Per-app volume slider
      • Per-app mute toggle
      • Inline editable per-app percentage
      • Expandable per-app 10-band EQ (32Hz, 64Hz, 125Hz, 250Hz, 500Hz, 1kHz, 2kHz, 4kHz, 8kHz, 16kHz)
  • Global output/input default device selection through CoreAudio.
  • Profile persistence per bundle identifier with optional "remember" toggle.
  • Settings UI for enabling/disabling remembered app profiles and overriding system volume shortcuts, with optional raw F11/F12 capture and configurable shortcut step size.
  • Runtime-only profile mode when remember is disabled.
  • Core Audio tap routing service (CoreAudioTapRoutingService) that:
    • Resolves PID to CoreAudio process objects
    • Creates per-app process taps (AudioHardwareCreateProcessTap)
    • Creates private aggregate devices and IOProc callbacks
    • Applies per-app mute/volume and 10-band EQ DSP in the callback path
    • Hard-clamps output samples to [-1, 1] to avoid clipping overflow
  • Fallback StubRoutingService when taps are unavailable.

Current Limitations

  • Core Audio tap flow requires macOS 14.2+.
  • Per-device hardware volume may be unavailable for some devices/scopes (shown as disabled with N/A).
  • DDC control depends on the display exposing speaker volume controls over DDC/CI.
  • Global F11/F12 interception may require macOS privacy approval for keyboard event capture.
  • Per-app input source routing is not implemented.
  • Tap-based routing reliability still depends on process/device behavior in HAL; additional hardening is still needed for production.

Build

swift build

Test

swift test

Xcode App Project

  • Open SoundControlMac.xcodeproj in Xcode.
  • Scheme: SoundControlMac
  • Target: SoundControlMac
  • Deployment target: macOS 14.2
  • Bundle ID: com.minkyu.soundcontrolmac

CLI validation command:

DEVELOPER_DIR=/Applications/Xcode-16.4.0.app/Contents/Developer xcodebuild -project SoundControlMac.xcodeproj -scheme SoundControlMac -configuration Debug -sdk macosx build

Project Structure

  • Sources/SoundControlMac/App: app entry and app delegate
  • Sources/SoundControlMac/Models: domain models
  • Sources/SoundControlMac/Services: CoreAudio device manager, app monitor, routing services
  • Sources/SoundControlMac/Stores: persistence and app-level state store
  • Sources/SoundControlMac/Views: menu bar and settings SwiftUI views
  • Tests/SoundControlMacTests: persistence tests

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages