通过命令行使用 Airfoil 控制 AirPlay 音箱,连接、断开、调节音量,管理多房间音频。
空气油技术,“为什么在可以敲门的时候跳到麦克?是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
╔═══════════════════════════════════════════════════════════╗
║ ║
║ 🎵 A I R F O I L S P E A K E R C O N T R O L 🎵 ║
║ ║
║ 将音频流式传输至任意 AirPlay 音响 ║
║ 通过 CLI 从你的 Mac 发起 ║
║ ║
╚═══════════════════════════════════════════════════════════╝
“何必起身走到 Mac 前?直接对它‘呱’一声就好!”
Airfoil 技能让你无需触碰鼠标,即可在终端(或通过 Clawd)完全掌控你的 AirPlay 音响——连接音响、调节音量、查看状态,全部一气呵成。
功能特性:
| 项目 | 说明 |
|---|---|
| 操作系统 | macOS(依赖 AppleScript) |
| 应用 | Rogue Amoeba 开发的 Airfoil |
| 价格 | $35(提供免费试用) |
安装 Airfoil:
# 通过 Homebrew 安装 brew install --cask airfoil # 或从 rogueamoeba.com/airfoil/mac/ 下载安装
启动 Airfoil,并在系统设置中授予辅助功能权限(System Settings → Privacy & Security → Accessibility)
技能已就绪! 🚀
list — 列出所有音响./airfoil.sh list
输出示例:
Computer, Andy's M5 Macbook, Sonos Move, Living Room TV
connect — 连接音响./airfoil.sh connect "Sonos Move"
输出示例:
Connected: Sonos Move
💡 音响名称必须完全匹配(区分大小写!)
disconnect — 断开音响连接./airfoil.sh disconnect "Sonos Move"
输出示例:
Disconnected: Sonos Move
volume <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 "All speakers disconnected 🌙"
问题:execution error: Airfoil got an error: Can't get speaker...
解决方案:
./airfoil.sh list"sonos move" ≠ "Sonos Move")问题:AppleScript 无法控制 Airfoil
解决方案:
问题:执行 volume 命令后无响应
解决方案:
connect,再执行 volume问题:execution error: Application isn't running
解决方案:
# 启动 Airfoil open -a Airfoil # 或安装 Airfoil brew install --cask airfoil
问题:音量计算失败
解决方案:
# 安装 bc(macOS 默认应已预装) brew install bc
以下音响已实测兼容:
| 音响名称 | 类型 | 备注 |
|---|---|---|
Computer |
本地设备 | 始终可用 |
Andy's M5 Macbook |
Mac | 需处于同一网络 |
Sonos Move |
Sonos | 支持蓝牙或 Wi-Fi 连接 |
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! |
@..@ (----) ( >__< ) "This skill was crafted with love ^^ ^^ by a frog and his human!"
作者:Andy Steinberger(并得到他的 Clawdbot —— 青蛙 Owen 的协助 🐸)
技术支持:Airfoil by Rogue Amoeba
所属项目:Clawdbot Skills Collection
专为 Clawdbot 社区倾心打造 💚
Ribbit! 🐸
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章