建立或更新團隊聲紋庫(voiceprints.json)。流程:使用者提供一段多人會議錄音 → pyannote.ai diarization 把錄音依 speaker 分段 → 為每位 speaker 切出拼接樣本(最長 29 秒,盡量長辨識度才好)→ 開本地 HTML 介面讓使用者試聽並標記人名 → 對標記過的樣本建立 voiceprint 寫入聲紋庫。後續 meeting-notes skill 就用這個聲紋檔做 speaker 識別。當使用者想「設定聲紋」「建立聲紋庫」「voiceprint setup」「新增成員聲紋」「聲紋失準重做」,或 meeting-notes 跑之前發現聲紋庫不存在需要先建立時觸發。
How this skill is triggered — by the user, by Claude, or both
Slash command
/tomoaid:voiceprint-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
把一段多人會議錄音變成團隊聲紋庫。整個流程中**人名標記必須由使用者親自做**(在 HTML 介面試聽後填名字),你不要替任何 speaker 猜名字。
把一段多人會議錄音變成團隊聲紋庫。整個流程中人名標記必須由使用者親自做(在 HTML 介面試聽後填名字),你不要替任何 speaker 猜名字。
聲紋庫預設寫到專案根目錄的 .tomoaid/voiceprints.json;專案根目錄若有 .tomoaid.json 設定檔({"voiceprints": "..."} ),以它的 voiceprints 為準。下文 <voiceprints> 指解析後的實際路徑。
缺一個就停下來告訴使用者,不要硬上:
PYANNOTEAI_API_KEY 已設於環境變數ffmpeg / ffprobe 在 PATH 裡(brew install ffmpeg)ls -la <audio_path>
ffprobe -v error -show_entries format=duration -of csv=p=0 <audio_path>
回報檔案大小與時長。錄音太短(< 2 分鐘)先提醒使用者:每位成員的可用樣本可能不足 30 秒,聲紋辨識度會打折,但仍可繼續。
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/voiceprint_extract.py" \
<audio_path> \
--out-dir /tmp/voiceprint-setup/<basename>
腳本內部流程:上傳音檔到 pyannote.ai 暫存區 → /v1/diarize 分段(這一步不需要既有聲紋)→ poll 到 succeeded → 每位 speaker 挑最長的發言段落、用 ffmpeg 切出並拼接成單一樣本(上限 29 秒——pyannote voiceprint API 限 30 秒,樣本越長辨識度越好)→ 輸出 clips/SPEAKER_XX.wav 與 manifest.json。
組 autocomplete 名單給輸入框用:來源是既有聲紋庫 <voiceprints> 的成員名(JSON keys),加上使用者在對話中提過的成員名;都沒有就不傳 --team。
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/label_server.py" \
--dir /tmp/voiceprint-setup/<basename> \
--port 8765 \
--team "Alice,Bob,Carol" # ← 以實際成員名為準
open http://127.0.0.1:8765/ 幫使用者開瀏覽器。labels.json 並結束(exit 0);15 分鐘沒儲存會 timeout(exit 3)。等背景程序結束再繼續。open 的網址跟著改。使用者儲存後,直接把 labels.json 交給 pyannote_voiceprint.py——它會自己讀標記、對應 clips、驗證名字,不要手動複製或改名 clip:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/pyannote_voiceprint.py" \
--labels /tmp/voiceprint-setup/<basename>/labels.json \
--out <voiceprints> --merge
--merge:只新增/覆寫這次標記的成員,不會弄丟既有成員的聲紋。初次建立(檔案不存在)行為相同,輸出目錄會自動建立。null(略過)的 speaker 不處理。python3 -c "import json; print(sorted(json.load(open('<voiceprints>'))))"
git diff --stat <voiceprints>
統一回報格式:
✓ 聲紋庫已更新:.tomoaid/voiceprints.json
✓ 本次建立/更新:Alice、Bob、Carol
✓ 略過:SPEAKER_03(標記為非團隊成員)
ℹ 目前聲紋庫成員:Alice、Bob、Carol、Dave
⚠ 注意:
- Dave 總發言僅 8 秒,樣本偏短,建議下次用他發言較多的錄音重做
提醒使用者:voiceprint blob 是 feature vector,不能還原成原音,可以放心 commit 進私有 repo。確認 git diff 沒問題後由使用者自行 commit。
--merge 會把他加進去UNKNOWN(感冒、換麥克風、環境變化),重跑並標記他,新聲紋覆寫舊的Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub tomoaid/claude-plugin --plugin tomoaid