返回顶部
m

music-identify

Identify songs from audio clips using AudD API and optionally queue them to Spotify. Triggers on /songsearch command, voice messages with song identification intent, or when user asks "what song is this." Also handles recall queries like "what did I shazam" or "what was that song" by reading the music log. Works with any audio file (OGG, MP3, WAV, etc.).

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.2.0
安全检测
已通过
116
下载量
0
收藏
概述
安装方式
版本历史

music-identify

# Music Identify Identify songs from audio using AudD, return song info with Spotify link, and optionally queue to the user's active Spotify session. ## Runtime Dependencies Required on `$PATH`: - `curl` — HTTP requests to AudD and Spotify APIs - `jq` — JSON parsing for all API responses - `python3` — Spotify OAuth flow only (`scripts/spotify-auth.py`) ## Credentials | Credential | Location | Required | Purpose | |---|---|---|---| | AudD API key | `~/.config/audd/api_key` | Yes | Song identification | | Spotify OAuth tokens | `~/.config/spotify/tokens.json` | No (optional) | Queue to Spotify | | Spotify app credentials | `~/.config/spotify/credentials.json` | No (optional) | Token refresh | **Security notes:** - All credential files should be restricted: `chmod 600`. - This skill does not read, store, or access any platform tokens (Telegram, Discord, etc.). Audio file download from messaging platforms is handled by the host agent, not by this skill. ## Trigger - User sends `/songsearch` then follows with a voice message or audio file - User asks to identify a song from audio ("what song is this", "identify this song", "shazam this") - User asks to recall previously identified songs ("what was that song", "what did I shazam") ## Setup ### AudD API Key (required) 1. Sign up at <https://audd.io> (free tier: 300 requests, no credit card) 2. Save key: ```bash mkdir -p ~/.config/audd echo "YOUR_KEY" > ~/.config/audd/api_key chmod 600 ~/.config/audd/api_key ``` ### Spotify Integration (optional) 1. Create a Spotify Developer app at <https://developer.spotify.com/dashboard> 2. Set redirect URI to your callback URL 3. Save credentials: ```bash mkdir -p ~/.config/spotify cat > ~/.config/spotify/credentials.json << 'EOF' {"client_id": "...", "client_secret": "...", "redirect_uri": "https://your-host/callback"} EOF chmod 600 ~/.config/spotify/credentials.json ``` 4. Run the auth flow: `python3 scripts/spotify-auth.py` 5. Open the printed URL in a browser, authorize, tokens save automatically 6. `chmod 600 ~/.config/spotify/tokens.json` ## Workflow — Song Identification When a song identification is triggered: 1. Prompt user for a voice clip if not already provided. 2. Save the audio file to a temp location (e.g., `/tmp/music-identify-<timestamp>.ogg`). The host agent handles downloading audio from the messaging platform (Telegram, Discord, etc.) — this skill only needs the local file path. 3. Run identification: ```bash scripts/identify.sh /path/to/audio-file.ogg ``` 4. Parse the JSON result and respond. 5. If Spotify is configured and active, queue the track. 6. Log the identification to `memory/music-log.json`. **Supported formats:** OGG/Opus, MP3, WAV, FLAC, M4A. No transcoding needed — AudD accepts all common audio formats. ## Workflow — Spotify Queue After a successful identification, if Spotify tokens exist at `~/.config/spotify/tokens.json`: ```bash # Check if anything is playing scripts/spotify-queue.sh status # Queue the identified track scripts/spotify-queue.sh queue "spotify:track:<track_id>" ``` If no active Spotify session is found, fall back to returning the Spotify link only. Token refresh is handled automatically by `spotify-queue.sh` on 401 responses. ## Response Format - **Found**: `🎵 {title} by {artist}` + Spotify link on next line. If Spotify active, note it was queued. - **Found, no Spotify match**: `🎵 {title} by {artist}` (no link) - **Not found**: "Couldn't identify that one. Try a longer clip with more of the melody (5+ seconds works best)." - **Error**: "Something went wrong with the identification. Try again." - **Missing AudD key**: "AudD API key not configured. Get one at https://audd.io and save to ~/.config/audd/api_key" ## Memory Logging Append identified songs to `memory/music-log.json` (one JSON object per line): ```json {"date":"2026-03-22","time":"14:30","title":"Viva La Vida","artist":"Coldplay","album":"Viva la Vida","spotify":"https://open.spotify.com/track/..."} ``` Create the file if it doesn't exist. For recall queries, read and present this log. ## Scripts | Script | Purpose | Dependencies | |---|---|---| | `scripts/identify.sh <audio_file>` | POST audio to AudD, return JSON | curl, jq | | `scripts/spotify-auth.py [--url]` | One-time Spotify OAuth flow | python3 | | `scripts/spotify-queue.sh queue <uri>` | Queue track to active Spotify | curl, jq | | `scripts/spotify-queue.sh status` | Check current Spotify playback | curl, jq | Exit codes for `identify.sh`: 0=found, 1=not found, 2=error. ## API Reference See `references/audd-api.md` for AudD endpoint details, parameters, and response format.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 music-identify-1776086161 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 music-identify-1776086161 技能

通过命令行安装

skillhub install music-identify-1776086161

下载 Zip 包

⬇ 下载 music-identify v1.2.0

文件大小: 7.16 KB | 发布时间: 2026-4-14 10:22

v1.2.0 最新 2026-4-14 10:22
v1.2.0: Security fix — removed all Telegram bot token references and config path grep instructions from SKILL.md. Audio download from messaging platforms is now explicitly delegated to the host agent. Skill only handles local audio files. Removed undocumented config path access. Should resolve VirusTotal and OpenClaw security scan flags.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部