Skip to content

loserxiong/AudioSwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AudioSwitch

English | 中文


English

A lightweight macOS menu bar application for quickly switching audio output devices.

macOS Swift License

Features

  • Menu Bar Integration - Lives in your menu bar, no Dock icon clutter
  • Floating HUD Window - Always-on-top widget in the corner of your screen
  • One-Click Switching - Switch audio output devices instantly
  • Real-time Updates - Automatically detects when audio devices are connected or disconnected
  • Smart Icons - Automatically displays appropriate icons for AirPods, headphones, speakers, etc.
  • Multi-Space Support - HUD window visible across all desktop spaces
  • Draggable Window - Position the HUD anywhere you like
  • Native Performance - Built with SwiftUI and Core Audio API, minimal resource usage

Screenshots

Collapsed Expanded
Collapsed Expanded

Installation

Option 1: Download Release

  1. Download the latest .dmg or .zip from Releases

  2. Extract and move AudioSwitch.app to your /Applications folder

  3. Important: Bypass Gatekeeper (required for unsigned apps)

    Since this app is not signed with an Apple Developer certificate, macOS will block it by default. To open it:

    Method A: Right-click to Open (Recommended)

    • Right-click (or Control-click) on AudioSwitch.app
    • Select "Open" from the context menu
    • Click "Open" in the dialog that appears
    • You only need to do this once

    Method B: System Settings

    • Try to open the app (it will be blocked)
    • Go to System Settings > Privacy & Security
    • Scroll down to find the message about AudioSwitch being blocked
    • Click "Open Anyway"
    • Enter your password if prompted

    Method C: Terminal Command

    xattr -cr /Applications/AudioSwitch.app

    Then open the app normally.

Option 2: Build from Source

  1. Clone this repository
    git clone https://github.com/loserxiong/AudioSwitch.git
  2. Open AudioSwitch.xcodeproj in Xcode
  3. Build and run (⌘R)

Usage

  • Left-click menu bar icon → Show quit menu
  • Right-click menu bar icon → Toggle HUD window visibility
  • Click chevron in HUD → Expand/collapse device list
  • Click device in list → Switch to that audio output
  • Drag HUD background → Move window position

Requirements

  • macOS 11.0 (Big Sur) or later
  • Apple Silicon or Intel Mac

Tech Stack

  • Swift & SwiftUI
  • AppKit (for menu bar and window management)
  • Core Audio API (for audio device control)
  • Combine (for reactive updates)

License

MIT License - feel free to use and modify.


中文

一款轻量级的 macOS 菜单栏应用,用于快速切换音频输出设备。

macOS Swift License

功能特点

  • 菜单栏集成 - 常驻菜单栏,不占用 Dock 空间
  • 浮窗 HUD - 始终置顶的小窗口,显示在屏幕角落
  • 一键切换 - 点击即可立即切换音频输出设备
  • 实时更新 - 自动检测音频设备的连接和断开
  • 智能图标 - 自动为 AirPods、耳机、扬声器等设备显示对应图标
  • 多桌面支持 - HUD 窗口在所有桌面空间都可见
  • 可拖拽窗口 - 将 HUD 放置在任意位置
  • 原生性能 - 使用 SwiftUI 和 Core Audio API 构建,资源占用极低

截图

收起状态 展开状态
收起 展开

安装方法

方式一:下载安装包

  1. Releases 下载最新的 .dmg.zip 文件

  2. 解压并将 AudioSwitch.app 移动到 /Applications(应用程序)文件夹

  3. 重要:绕过安全验证(未签名应用必需)

    由于此应用没有 Apple 开发者签名,macOS 默认会阻止打开。请按以下方法操作:

    方法 A:右键打开(推荐)

    • AudioSwitch.app 上点击右键(或按住 Control 点击)
    • 从菜单中选择「打开」
    • 在弹出的对话框中点击「打开」
    • 只需操作一次,之后可正常打开

    方法 B:系统设置

    • 尝试打开应用(会被阻止)
    • 前往 系统设置 > 隐私与安全性
    • 向下滚动,找到关于 AudioSwitch 被阻止的提示
    • 点击「仍要打开」
    • 如有提示,输入密码确认

    方法 C:终端命令

    xattr -cr /Applications/AudioSwitch.app

    然后正常打开应用即可。

方式二:从源码编译

  1. 克隆此仓库
    git clone https://github.com/loserxiong/AudioSwitch.git
  2. 用 Xcode 打开 AudioSwitch.xcodeproj
  3. 编译并运行(⌘R)

使用方法

  • 左键点击 菜单栏图标 → 显示退出菜单
  • 右键点击 菜单栏图标 → 显示/隐藏 HUD 窗口
  • 点击箭头 → 展开/收起设备列表
  • 点击设备 → 切换到该音频输出设备
  • 拖拽 HUD 背景 → 移动窗口位置

系统要求

  • macOS 11.0 (Big Sur) 或更高版本
  • Apple Silicon 或 Intel Mac

技术栈

  • Swift & SwiftUI
  • AppKit(菜单栏和窗口管理)
  • Core Audio API(音频设备控制)
  • Combine(响应式更新)

开源协议

MIT License - 可自由使用和修改。


Contributing

Issues and Pull Requests are welcome!

Acknowledgments

Built with SwiftUI and Core Audio API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages