智能网络电台随身听
简介
基于 mpv/ffplay 的跨平台网络电台播放器,支持 Radio Browser 全球曲库搜索、收藏管理与持久化设置,为开发者与音乐爱好者提供轻量高效的流媒体收听体验。
原始描述
Control internet radio playback with stream/ station search, favorites, volume, pause/resume, stop, next, and show current playback using mpv or ffplay.
通过你的 Agent 添加
安装目录:agent-radio/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Agent Radio Skill 是一款面向 OpenClaw 生态的网络电台播放器,通过命令行工具实现完整的流媒体播放控制。用户可通过 /radio 指令触发播放、搜索、收藏管理等操作:直接播放 URL 链接(play <url>)、按名称搜索全球电台(find <query>)、管理个人收藏夹(favorite add/remove),以及常规的播放控制(stop/pause/next/volume)。技能内置 Radio Browser 开放目录作为曲库来源,同时维护本地 stations.json 作为备选列表。
播放引擎采用双驱动架构:优先使用 mpv 实现硬件音频设备自动检测与缓存优化,若未安装则降级至 ffplay 保证基础可用性。配置持久化存储于 preferences.json,涵盖最后播放记录、默认音量、收藏列表及播放状态,确保跨会话体验连贯。
显著优点
跨平台兼容性强:自动识别 macOS(CoreAudio)、Linux(ALSA)、Windows(DirectSound)的默认音频设备,无需手动配置即可运行。双播放器降级机制显著降低部署门槛。
曲库生态开放:集成 Radio Browser 全球开放电台目录,支持模糊搜索与即时播放;同时允许用户通过 URL 添加任意流媒体源,兼顾开放性与自由度。
状态持久化设计:收藏列表、音量偏好、播放进度均自动保存,配合 PID 追踪实现进程级状态管理,避免重复配置。
轻量无侵入:纯 CLI 交互模式,不占用 GUI 资源,适合开发者在编码环境中后台播放音乐。
潜在局限
依赖外部二进制:必须预装 mpv 或 ffmpeg/ffplay,且推荐通过 Homebrew 等包管理器安装,Windows 环境配置相对复杂。缺少依赖时功能完全不可用。
无可视化界面:纯命令行操作对非技术用户不够友好,查看收藏列表、搜索结果的呈现形式较为简陋。
网络稳定性敏感:流媒体播放依赖实时网络连接,未内置断线重连或缓冲增强机制,弱网环境可能出现中断。
单实例限制:同一时刻仅支持单一音频流播放,多频道对比收听需手动切换。
适合人群
- 开发者/工程师:习惯终端环境工作,追求后台轻音乐且不切换应用窗口
- 极客/自托管爱好者:偏好开源工具链,愿意自行配置 mpv/ffmpeg 环境
- 网络电台重度用户:需要跨平台统一管理多个收藏电台,重视播放状态 persistence
- OpenClaw/Claude Code 用户:已在该生态内工作,希望扩展 Agent 的多媒体能力
使用风险
依赖项维护风险:mpv/ffmpeg 版本迭代可能引入 API 变更,需关注技能更新以保持兼容性。建议锁定稳定版本。
音频设备异常:自动检测逻辑在特殊声卡配置或多声卡环境下可能选择非预期设备,需通过环境变量手动覆盖。
进程残留风险:异常退出可能导致 PID 记录与实际进程脱节,虽已设计自清理机制,极端情况下仍需手动 kill 残留播放器进程。
版权合规注意:Radio Browser 收录的电台流版权状态各异,商业场景使用需自行确认授权范围。
技能正文
name: agent-radio
description: Control internet radio: play streams, search stations, manage favorites, volume, stop/pause/next, and inspect current playback. Uses mpv with audio device auto-detection and ffplay fallback. Settings persist between runs.
user-invocable: true
command-dispatch: tool
command-tool: radio
command-arg-mode: raw
metadata:
openclaw:
requires:
bins:
- mpv
- ffplay
optional:
bins: []
install:
- id: brew-mpv
kind: brew
formula: mpv
label: Install mpv (brew)
- id: brew-ffmpeg
kind: brew
formula: ffmpeg
label: Install ffmpeg (ffplay)
version: 1.1.1
license: MIT
author: Artem Pisarev
Agent Radio Skill
Internet radio player for OpenClaw with station search, favorites, volume control, and playback management.
When to Use
Use when user wants to:
- Play an internet radio stream by URL
- Search for stations by name from the live Radio Browser directory
- Play a random built-in station when no target is provided
- Manage favorite stations (add, remove, list)
- Control volume, pause/resume, stop, skip to next
- Check what is currently playing
- Have a persistent radio experience across sessions
Tools
This skill provides the following CLI commands in scripts/:
play <url|station_name> [volume]
Play a stream by URL or by name from favorites or the built-in list.
If no target is provided, the skill chooses a random station from stations.json.
Optional volume is 0-100 and defaults to the saved setting.
Examples:
play https://stream.zeno.fm/0r0xa792kwzuvplay BBC Radio 1play "Jazz 24 (KNKX)" 60
stop
Stop playback immediately.
pause
Pause or resume the current playback process.
next
Skip to the next favorite station in a cycle.
volume [level]
Show the current volume or set a new default volume from 0-100.
Examples:
volumevolume 75
now
Show the current station URL, volume, PID, and playback status.
favorite add <name> <url>
Add a station to favorites.
favorite remove <name>
Remove a station from favorites.
list
List all favorite and built-in stations.
find <query> [number]
Search the Radio Browser directory. When number is provided, play that result immediately.
Examples:
find jazzfind "lofi hip hop" 1
Configuration
Preferences are stored in: {baseDir}/preferences.json
{
"last_station": "",
"volume": 80,
"favorites": [
{"name": "BBC Radio 1", "url": "http://..."},
{"name": "Jazz 24 (KNKX)", "url": "https://..."}
],
"audio_device": "auto",
"current_pid": null,
"paused": false
}
Audio device auto-detection:
- macOS:
coreaudio/BuiltInSpeakerDevice - Linux:
alsa/default - Windows:
directsound/default
Override locations when needed:
AGENT_RADIO_BASE_DIRAGENT_RADIO_PREF_FILEAGENT_RADIO_STATIONS_FILE
Implementation Notes
- Primary player:
mpv --no-video --audio-device=<device> --volume=<vol> --cache=yes <url>
- Fallback player:
ffplay -nodisp -autoexit <url>
- Playback runs in the background and stores PID plus paused state in preferences.
- On
play, any existing playback is stopped before starting the next stream.
- Station lookup is case-insensitive across favorites and built-in stations.
next cycles favorite URLs instead of depending on station-name matching.
Error Handling
- If both
mpv and ffplay are missing, return install guidance.
- If dependencies like
jq or curl are missing, fail early with a clear message.
- If a stored PID is stale, clear it automatically.
- If station search returns no matches, explain how to retry with another query or a direct URL.
Examples for Users
/radio play https://stream.zeno.fm/0r0xa792kwzuv
/radio play "BBC Radio 1"
/radio volume 70
/radio now
/radio find jazz
/radio find "lofi hip hop" 1
/radio favorite add "Lounge Jazz" https://jazz.stream
/radio list
/radio next
/radio stop
Future Enhancements
- Built-in station directory with genres and countries
- Recording streams to file
- Equalizer presets
- Web interface control
mpv --no-video --audio-device=<device> --volume=<vol> --cache=yes <url>ffplay -nodisp -autoexit <url>play, any existing playback is stopped before starting the next stream.next cycles favorite URLs instead of depending on station-name matching.- If both
mpvandffplayare missing, return install guidance. - If dependencies like
jqorcurlare missing, fail early with a clear message. - If a stored PID is stale, clear it automatically.
- If station search returns no matches, explain how to retry with another query or a direct URL.
Examples for Users
/radio play https://stream.zeno.fm/0r0xa792kwzuv
/radio play "BBC Radio 1"
/radio volume 70
/radio now
/radio find jazz
/radio find "lofi hip hop" 1
/radio favorite add "Lounge Jazz" https://jazz.stream
/radio list
/radio next
/radio stop
Future Enhancements
- Built-in station directory with genres and countries
- Recording streams to file
- Equalizer presets
- Web interface control
/radio play https://stream.zeno.fm/0r0xa792kwzuv
/radio play "BBC Radio 1"
/radio volume 70
/radio now
/radio find jazz
/radio find "lofi hip hop" 1
/radio favorite add "Lounge Jazz" https://jazz.stream
/radio list
/radio next
/radio stop
- Built-in station directory with genres and countries
- Recording streams to file
- Equalizer presets
- Web interface control
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。