AudioPriorityBar
A native macOS menu bar app for managing audio device priorities
Install / Use
/learn @tobi/AudioPriorityBarREADME
Audio Priority Bar
<p align="center"> <img src="icon.png" width="128" height="128" alt="Audio Priority Bar Icon"> </p>A native macOS menu bar app that automatically manages audio device priorities. Set your preferred order for speakers, headphones, and microphones - the app automatically switches to the highest-priority connected device.

Features
- Priority-based auto-switching: Devices are ranked by priority. When a higher-priority device connects, it automatically becomes active.
- Separate speaker/headphone modes: Output devices are categorized as either speakers or headphones, each with their own priority list.
- Manual override: Enable "Custom" mode (hand icon) to disable auto-switching and select devices freely.
- Device memory: Remembers all devices you've ever connected, even when disconnected. Edit mode shows disconnected devices with "last seen" timestamps.
- Per-category ignore: Hide devices from specific categories without affecting others.
- Drag-to-reorder: Reorder devices by dragging or using up/down arrows.
- Volume control: Adjust volume with slider or scroll wheel.
- Menu bar integration: Shows current mode icon and volume percentage.
Installation
Requirements
- macOS 13.0 (Ventura) or later
Build from Source
-
Clone the repository:
git clone https://github.com/tobi/AudioPriorityBar.git cd AudioPriorityBar -
Build using the build script:
./build.sh -
The app will be at
dist/AudioPriorityBar.app
Or open AudioPriorityBar.xcodeproj in Xcode and build with ⌘R.
Download Release
Check the Releases page for pre-built binaries.
Usage
Modes
| Mode | Icon | Behavior | |------|------|----------| | Speakers | 🔊 | Shows speaker devices, auto-switches to highest priority | | Headphones | 🎧 | Shows headphone devices, auto-switches to highest priority | | Custom | ✋ | Shows all devices, no auto-switching |
Managing Priorities
- Click a device: Moves it to #1 priority (in normal mode) or just selects it (in custom mode)
- Drag devices: Reorder by dragging the handle
- Up/Down arrows: Fine-tune order on hover
Device Actions (hover menu)
- Move to Speakers/Headphones: Change device category
- Ignore as [category]: Hide from current category only
- Ignore entirely: Hide from both speaker and headphone lists
- Forget Device: Remove disconnected device from memory
Edit Mode
Click "Edit" in the footer to:
- See all devices ever connected (disconnected ones grayed out)
- Reorder disconnected devices in the priority list
- View "last seen" timestamps
- Forget old devices you no longer use
How It Works
- Device Discovery: Uses CoreAudio to enumerate audio devices and listen for changes.
- Priority Storage: Device priorities are stored in UserDefaults, keyed by device UID (stable across reconnects).
- Auto-Switching: When devices connect/disconnect, the app automatically selects the highest-priority available device for the current mode.
- Categories: Each output device is assigned to either "speaker" or "headphone" category, with separate priority lists.
Project Structure
AudioPriorityBar/
├── AudioPriorityBarApp.swift # App entry, MenuBarExtra, AudioManager
├── Models/
│ └── AudioDevice.swift # Device model, OutputCategory enum
├── Services/
│ ├── AudioDeviceService.swift # CoreAudio wrapper
│ └── PriorityManager.swift # Priority persistence
└── Views/
├── MenuBarView.swift # Main popover UI
└── DeviceListView.swift # Device list and row components
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.
Acknowledgments
Built with SwiftUI and CoreAudio for macOS.
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
