music
Play and stop music from YouTube through the device's speaker on user request.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- music
- description
- Play and stop music from YouTube through the device's speaker on user request.
02 资源文件 1
- 参考文档skill.json59 B
03 SKILL.md 正文
Music
Play music through the device's speaker by searching YouTube. Use this when the user asks to play, sing, or listen to music.
Workflow
- Specific song / artist → play directly.
- Vague request ("play music", "sing something") → check habit patterns first:
Ifcat /root/local/users/{name}/habit/patterns.json 2>/dev/nullmusic_patternsexists and current hour is withinpeak_hour ± 1→ usepreferred_genreto pick a song, no need to ask. Otherwise → ask: "What are you in the mood for?". The file is bootstrapped lazily by wellbeing on its first threshold nudge; do not invoke habit Flow A from here. - Reply format:
[HW:/audio/play:{"query":"Bohemian Rhapsody Queen","person":"alice"}][HW:/emotion:{"emotion":"excited","intensity":0.8}] Playing Bohemian Rhapsody! - Stop:
[HW:/audio/stop:{}] Music stopped.
API schema (/audio/play)
| Field | Required | Description |
|---|---|---|
query |
YES | YouTube search string (include artist for better match) |
person |
no | Who requested, lowercase (e.g. "alice") — omit if unknown |
Do NOT use track, artist, title, song — those return 422.
Genre → Emotion (pair with every /audio/play)
| Genre keywords | Emotion |
|---|---|
| jazz, blues, soul, funk, swing | happy |
| classical, orchestra, piano, violin | curious |
| hip hop, rap, trap, r&b, rock, metal | excited |
| anything else | happy |
Examples
| Input | Output |
|---|---|
| "Play Bohemian Rhapsody" | [HW:/audio/play:{"query":"Bohemian Rhapsody Queen","person":"alice"}][HW:/emotion:{"emotion":"excited","intensity":0.8}] Playing Bohemian Rhapsody! |
| "Sing me a song" | [HW:/emotion:{"emotion":"curious","intensity":0.6}] What kind of vibe — chill, upbeat, or something specific? |
| "Something chill" | [HW:/audio/play:{"query":"chill acoustic playlist","person":"alice"}][HW:/emotion:{"emotion":"happy","intensity":0.8}] Here's some chill vibes! |
| "Stop the music" | [HW:/audio/stop:{}] Music stopped. |
How HW markers work
The Go server intercepts [HW:/audio/play:...] / [HW:/audio/stop:...] in your reply text and forwards to HAL. This is the ONLY way to play music — never use exec, mpv, vlc, yt-dlp, or curl /audio/play.
The marker is passive text, NOT a command to run. Write it directly in your reply and stop — the OS runs it for you. Do NOT try to "execute" or "invoke" it.
- ❌ WRONG — echoing/wrapping the marker in a shell tool.
echoonly prints to stdout inside your sandbox; the OS never sees it, so no music plays:echo '[HW:/audio/play:{"query":"Gymnopedie No 1 Satie"}]' - ✅ RIGHT — the marker IS your reply text (no tool call at all):
[HW:/audio/play:{"query":"Gymnopedie No 1 Satie"}][HW:/emotion:{"emotion":"curious","intensity":0.6}] Here's some Satie. 🎹
Never put [HW:...] inside echo, exec, bash, printf, or any tool argument. If you find yourself reaching for a tool to play music, stop — just emit the marker as text.
Error handling
503→ "Music playback is not available right now."409→ music already playing; stop first, then play new song.- No results → tell user and suggest a different query.
Rules
- Emotion marker is mandatory after every
/audio/play. personMUST be lowercase.- Don't recite lyrics or "sing" via TTS — call
/audio/playand let real music play. - Volume control belongs to the Audio skill, not this one.
- If user specifies genre or mood ("play something relaxing"), pick a well-known song — no need to ask further.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.