名称: airfoil
描述: 通过命令行控制 Airfoil 来管理 AirPlay 扬声器。使用简单的 CLI 命令连接、断开连接、设置音量以及管理多房间音频。
元数据: {"clawdbot":{"emoji":"🔊","os":["darwin"],"requires":{"bins":["osascript"]}}}
╔═══════════════════════════════════════════════════════════╗
║ ║
║ 🎵 A I R F O I L 扬 声 器 控 制 🎵 ║
║ ║
║ 通过 Mac 命令行将音频流传输到任何 AirPlay 扬声器 ║
║ ║
╚═══════════════════════════════════════════════════════════╝
"何必跳到 Mac 前,对它呱呱叫不就行了?" 🐸
Airfoil 技能让你可以直接在终端(或通过 Clawd!)全面控制你的 AirPlay 扬声器。无需触碰鼠标,即可连接扬声器、控制音量、查看状态。
核心功能:
- 📡 列出 — 显示所有可用扬声器
- 🔗 连接 — 连接到指定扬声器
- 🔌 断开 — 断开与指定扬声器的连接
- 🔊 音量 — 控制音量 (0-100%)
- 📊 状态 — 显示已连接扬声器及其音量
| 项目 | 详情 |
|---|---|
| 操作系统 | macOS(使用 AppleScript) |
| 应用 | Rogue Amoeba 出品的 Airfoil |
| 价格 | 35 美元(提供免费试用) |
# 或从 rogueamoeba.com/airfoil/mac/ 下载
```
启动 Airfoil 并授予辅助功能权限(系统设置 → 隐私与安全性 → 辅助功能)
技能准备就绪! 🚀
list — 列出所有扬声器./airfoil.sh list
输出示例:
Computer, Andy's M5 Macbook, Sonos Move, Living Room TV
connect <speaker> — 连接扬声器./airfoil.sh connect "Sonos Move"
输出示例:
Connected: Sonos Move
💡 扬声器名称必须完全匹配(区分大小写!)
disconnect <speaker> — 断开扬声器连接./airfoil.sh disconnect "Sonos Move"
输出示例:
Disconnected: Sonos Move
volume <speaker> <0-100> — 设置音量# 设置为 40%
./airfoil.sh volume "Sonos Move" 40
# 设置为最大音量
./airfoil.sh volume "Living Room TV" 100
# 夜间静音模式
./airfoil.sh volume "Sonos Move" 15
输出示例:
Volume Sonos Move: 40%
status — 显示已连接扬声器./airfoil.sh status
输出示例:
Sonos Move: 40%
Living Room TV: 65%
如果无连接:
No speakers connected
./airfoil.sh connect "Sonos Move"
./airfoil.sh volume "Sonos Move" 50
# → 现在打开 Spotify/Apple Music 享受吧!
./airfoil.sh connect "Living Room TV"
./airfoil.sh volume "Living Room TV" 70
./airfoil.sh disconnect "Sonos Move" # 如果仍连接着
for speaker in "Sonos Move" "Living Room TV"; do
./airfoil.sh disconnect "$speaker" 2>/dev/null
done
echo "所有扬声器已断开连接 🌙"
问题: execution error: Airfoil got an error: Can't get speaker...
解决方案:
1. 检查拼写:./airfoil.sh list
2. 扬声器名称区分大小写 ("sonos move" ≠ "Sonos Move")
3. 扬声器必须在同一网络
4. 扬声器必须已开机且可访问
问题: AppleScript 无法控制 Airfoil
解决方案:
1. 系统设置 → 隐私与安全性 → 辅助功能
2. 添加终端(或 iTerm)
3. 添加 Airfoil
4. 重启 macOS(有时是必要的 🙄)
问题: 音量命令没有效果
解决方案:
1. 设置音量前扬声器必须已连接
2. 先 connect,再 volume
3. 部分扬声器有硬件端限制
问题: execution error: Application isn't running
解决方案:
# 启动 Airfoil
open -a Airfoil
# 或安装它
brew install --cask airfoil
问题: 音量计算失败
解决方案:
# 安装 bc(macOS 上通常已预装)
brew install bc
以下扬声器已通过测试:
| 扬声器 | 类型 | 备注 |
|---|---|---|
Computer |
本地 | 始终可用 |
Andy's M5 Macbook |
Mac | 在网络上时可见 |
Sonos Move |
Sonos | 蓝牙或 WiFi |
Living Room TV |
Apple TV | 通过 AirPlay |
💡 使用
./airfoil.sh list来发现你自己的扬声器!
此技能可与 Clawd 完美配合!示例:
"Hey Clawd, connect the Sonos Move"
→ ./airfoil.sh connect "Sonos Move"
"Turn the music down"
→ ./airfoil.sh volume "Sonos Move" 30
"Which speakers are on?"
→ ./airfoil.sh status
| 版本 | 日期 | 变更内容 |
|---|---|---|
| 1.0.0 | 2025-01-25 | 初始版本发布 |
| 1.1.0 | 2025-06-10 | 文档优化 🐸 |
| 1.2.0 | 2025-06-26 | 翻译为英文,适配 ClawdHub! |
@..@
(----)
( >__< ) "此技能由一只青蛙和他的主人
^^ ^^ 倾心打造!"
作者: Andy Steinberger(感谢他的 Clawdbot 青蛙伙伴 Owen 的帮助 🐸)
技术支持: Rogue Amoeba 出品的 Airfoil
所属项目: Clawdbot 技能集