Communitygithub.com

broomva/skills

本地TTS、语音克隆、语音设计和视频配音,基于OmniVoice Studio MCP服务器(开源ElevenLabs替代品;数据不离开机器,运行于MPS/CUDA/CPU)。

skills 是什么?

该项目提供了一个名为OmniVoice的本地化语音合成、克隆和配音技能,通过MCP服务器实现。它支持646种语言的文本转语音、基于3秒参考片段的语音克隆、按性别/年龄/口音/音高/风格设计语音、视频配音以及语音档案管理。主要优势在于完全本地运行,不依赖任何云API(如ElevenLabs),保护隐私且零成本,特别适合需要离线处理、多语言支持或对隐私敏感的场景。技能适用于Claude Code、Cursor、Codex等支持MCP协议的AI Agent平台。工作流程包括:通过`generate_speech`工具配合`profile_id`或`instruct`参数生成语音;使用内建脚本录制和创建克隆语音;通过REST API管理语音档案。当OpenAI TTS、Edge TTS或kokoro等方案在多语言或隐私方面不足时,OmniVoice是理想的替代选择。

兼容平台~Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/broomva/skills/tree/HEAD/skills/audio/omnivoice

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

OmniVoice

概述

通过OmniVoice Studio MCP服务器在本地生成音频。工具:generate_speech、list_voices、list_personalities、list_languages、check_health。资源:voice://{id}、history://recent。

前提条件——后端必须正在运行

所有MCP工具都会访问 $OMNIVOICE_API_URL(默认为 http://localhost:3900)。如果后端未运行,每个工具都将返回连接错误。安装并启动:

git clone https://github.com/debpalash/OmniVoice-Studio.git "$OMNIVOICE_HOME"
cd "$OMNIVOICE_HOME"
uv sync
VIRTUAL_ENV="$(pwd)/.venv" uv pip install 'mcp[cli]'

然后:

scripts/check-health.sh        # 退出码0表示运行正常
scripts/start-backend.sh       # 后台启动(自动检测MPS/CUDA)

首次合成调用时会从HuggingFace惰性下载 k2-fsa/OmniVoice 模型(约2.4 GB)——后续启动时缓存。

任务索引——选择合适的工具

任务工具说明
验证后端是否运行check_health返回 `{"status":"ok","device":"mps
使用已保存的语音将文本转为音频generate_speech(text, profile_id)返回base64编码WAV。profile_id="demo0001" 为内置演示语音
无需克隆的文本转音频(语音设计)generate_speech(text, instruct="…")省略 profile_id;传入 instruct,例如 "warm middle-aged female narrator, calm pace"
多语言语音生成generate_speech(text, language="es")任意ISO 639代码或 "Auto"
列出已有语音list_voices返回id、名称、类型、个性
列出现成个性预设list_personalities返回 narrator / casual / news-anchor 等及其 instruct 字符串
列出支持的语言list_languages总计646种;返回20种常用语言以及总数

对于非平凡决策(使用哪个引擎、何时选择OmniVoice而非kokoro / Edge TTS / ElevenLabs),请参见 references/engines-comparison.md。

有关MCP连接细节、后端生命周期、故障排除及彻底卸载,请参见 references/mcp-setup.md。

常见工作流

1. 使用演示语音进行一次性语音生成

# 通过MCP客户端调用(您的agent将自动完成):
result = generate_speech(
    text="Hello — this is OmniVoice generating speech locally.",
    profile_id="demo0001",
    language="English",
    steps=16,                   # 8 = 快速/草稿 · 16 = 平衡 · 32 = 高质量
)
# result 为 JSON,包含 audio_id、generation_time_s、audio_duration_s、format、wav_base64

基准测试:在Apple Silicon MPS上,16个扩散步数下,生成4.2秒音频大约需要24秒服务器端时间。

2. 将WAV保存到磁盘并播放

工具返回base64编码的PCM WAV(16位、单声道、24 kHz)。解码并写入:

import base64, json
payload = json.loads(result_text)            # 解析工具返回的JSON
open("out.wav","wb").write(base64.b64decode(payload["wav_base64"]))

在macOS上:afplay out.wav。使用 ffmpeg -i out.wav -codec:a libmp3lame -b:a 128k out.mp3 转换为MP3。

3. 语音克隆——端到端配方

克隆需要一个3-10秒的参考片段,模型将其用作说话人嵌入。MCP服务器不暴露配置文件的创建——它只读取现有配置文件。创建方法有两种:

方法A——使用捆绑脚本(macOS,推荐用于新的克隆):

scripts/record-reference.sh ~/Downloads/my-ref.wav 12 1
# 参数:输出路径 原始录音时长(秒) 麦克风索引
# 默认 mic_index=1(MacBook内置);列出设备:
#   ffmpeg -f avfoundation -list_devices true -i ""

该脚本通过macOS的 say 和 /System/Library/Sounds/Ping.aiff 提供可听见的倒计时和开始/结束提示,以便用户知道何时说话(终端stdout有缓冲——文本“speak now”提示到达太晚)。它会录制一个较长的原始窗口,然后通过 silenceremove + atrim 修剪到约10秒的语音,播放以验证,并打印下一步的 curl 命令。

方法B——手动:

# 1. 录制(单声道,24 kHz原生——与模型内部速率匹配)
ffmpeg -f avfoundation -i ":1" -t 12 -ac 1 -ar 24000 raw.wav

# 2. 修剪前导静音并截取前10秒语音
ffmpeg -i raw.wav \
  -af "silenceremove=start_periods=1:start_silence=0.05:start_threshold=-40dB,atrim=end=10" \
  -ac 1 -ar 24000 ref.wav

# 3. 验证
ffmpeg -i ref.wav -af volumedetect -f null - 2>&1 | grep volume   # 最大值应 > -20 dB
afplay ref.wav

向 /profiles 发送POST请求(multipart/form-data——必填字段:name、ref_audio):

curl -X POST http://127.0.0.1:3900/profiles \
  -F "name=carlos-clone" \
  -F "[email protected]" \
  -F "ref_text=The exact text spoken in the clip" \
  -F "language=English" \
  | python3 -m json.tool
# 返回 { "id": "abc12345", "name": "carlos-clone" }

创建后,将 profile_id 传递给 generate_speech(通过MCP)或直接通过 POST /generate 调用。配置文件持久化存储在SQLite中,参考音频文件保存在 ~/Library/Application Support/OmniVoice/voices/<id>.<ext>(后端保留上传的扩展名——如果是WAV则为 .wav,MP3则为 .mp3,等等)。配置文件在后端重启后仍然保持。

对质量有实质性影响的参考片段提示:

因素为何重要
单一说话人混合说话人会使嵌入模糊
干净语音,无音乐/噪音模型也会嵌入噪音
自然韵律(避免使用 pangrams)扩散采样复制韵律,而不仅仅是音色
3-10秒是最佳长度< 3秒信息不足;> 10秒增加计算量而不提升质量
ref_text 与实际说出内容匹配提高对齐效果,尤其对于有噪音的参考片段
language 正确语言错误会导致跨语言迁移伪影
响度峰值 ≥ -15 dB较静的参考片段也能工作,但归一化效果差

4. 语音设计(无需参考片段)

省略 profile_id;提供一个描述所需语音的 instruct 字符串:

generate_speech(
    text="Welcome to the future of agentic systems.",
    instruct="warm middle-aged female narrator, calm authoritative pace, documentary style",
)

通过 list_personalities 获取预制指示,并复制与需求匹配的指示(narrator、casual、news-anchor等)。

5. 视频配音(仅限Web界面)

MCP服务器不公开配音端点。完整的转写→翻译→重新配音→混流管道位于桌面UI($OMNIVOICE_HOME 中的 bun run desktop)和 /dub/* REST路由之后。当用户要求配音视频时,请引导他们使用UI;本技能仅用于上述合成原语。

何时不使用OmniVoice

  • 在弱硬件上进行快速英语语音生成 → kokoro-tts 体积小约10倍,在CPU上可实现2倍实时合成(参见 references/engines-comparison.md)
  • 最低摩擦的一次性TTS → Edge TTS无需安装或后端
  • 不考虑成本的最佳质量 → ElevenLabs在英语语音的自然度上仍然领先;OmniVoice在多语言和克隆方面持平或更优
  • 实时流式听写 → 使用OmniVoice桌面小部件(⌘+⇧+Space),而非MCP服务器

参考资料

后端Swagger / OpenAPI:http://127.0.0.1:3900/docs(后端运行时)。

上游:github.com/debpalash/OmniVoice-Studio — FSL-1.1-ALv2(免费用于个人/内部/非商业用途;每个版本发布两年后自动转换为Apache-2.0)。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

broomva/skills

>- Speak an explanation out loud while working in any project — tiered text-to-speech with a pluggable backend (ElevenLabs by default and quota-guarded, macOS `say` via `--fast` for free instant local speech, local OmniVoice as an unlimited private tier). Markdown-aware, so code fences, URLs and deep paths collapse to short spoken placeholders instead of being dictated character by character, while snake_case identifiers survive intact so the listener can still search for them. Every utterance is saved to disk for later replay. Also carries a **talk mode** toggle: turn it on and the agent speaks a full readback of every turn, for as long as that session lasts — the whole response, not a summary of it, with `brief` and `marker` levels for when you want less. Talk mode is off by default and scoped to the single session that enabled it, so parallel agents in other worktrees stay silent. Use when the user asks to hear something rather than read it — an explanation of a change, a walkthrough of what just happen...

broomva/skills

Shop Tiendas D1 (Colombia, d1.com.co) from the command line — search the catalogue, resolve your nearest physical store, price a basket against that store's real stock, and quote delivery. D1 runs VTEX IO (account `d1tiendas`), so this drives its public storefront API with no admin key at all — catalogue and cart work fully anonymously, and a one-time emailed code unlocks order history. Handles the two traps that make naive D1 automation wrong — availability is regionalized (an unregioned query reports a national catalogue nobody can actually buy from) and prices arrive in two different units (search reports whole pesos, checkout reports hundredths, a silent 100x). Builds and prices baskets; it deliberately cannot pay, handing a checkout URL to a human instead. USE WHEN the user wants to find D1 products or prices, check whether D1 delivers somewhere, build or cost a D1 grocery basket, compare D1 items, or review their D1 orders. NOT FOR other Colombian retailers (Éxito, Jumbo, Ara, Alkosto), and not for c...

broomva/skills

Stateful, local-first household toxics inventory + swap engine. Identify the items in a home that carry endocrine disruptors and persistent chemicals (BPA/BPS, phthalates, PFAS/PTFE, parabens, flame retardants, VOCs, microplastics), score each by *real* exposure (severity x presence x how it's used x condition), and track the swap to a safer alternative from "flagged" -> "sourced" -> "swapped". Ships a grounded, cited knowledge graph of ~20 hazards, ~40 item-classes, and ~40 alternatives. Hands sourcing off to the `procurer` skill. The skill's state is the source of truth — the agent is the app.

broomva/skills

Tekton — the shared architecture-intent substrate for co-designing systems with the agent. One typed graph across six tiers (system / journey / data / infra / decisions / qualities); views are queries, not separate diagrams. The canonical artifact is a diff-friendly YAML model both human and agent read and write; it renders to Mermaid (agent-legible, GitHub-native) and a self-contained tabbed HTML viewer (human-visual). Cross-tier traceability (`tekton query <from> <to>`) answers "which infra does this user-journey step touch?" as a path query. USE WHEN: designing or thinking deeply about architecture, a system, a data model, user journeys/flows, or a technical plan WITH the agent; when a Category-C HTML doc isn't enough because you need to see AND edit AND traverse the design across tiers; "let's design X", "architect this", "model the system", "draw the flow", "how does this fit together", "diagram this", "/tekton". NOT FOR: a one-off throwaway diagram (use Mermaid inline); prose-only ADRs (write the ADR...

broomva/skills

Generate a polished Remotion video and X thread showcasing the full agent skills inventory. Use when creating social media content about skills, rendering category-based skill visualizations, or producing animated showcases of agent capabilities. Triggers on "skills video", "showcase skills", "skills thread", "render skills", "social content for skills", or requests to visualize the skills inventory.

broomva/skills

OpenCaptions extension for Content Engine — adds intent-driven CWI (Caption With Intent) captions to the post-production pipeline. Hooks into the grade → caption → final stage. Generates captions that understand video intent (pitch, volume, emotion, emphasis) and style themselves accordingly with variable font weight, size, and color. Uses the OpenCaptions CLI or MCP server. Triggers on: 'add captions', 'opencaptions', 'CWI captions', 'intent captions'.

broomva/skills

Produce polished product launch videos using the Liquid Glass aesthetic — dark void backgrounds, 3D perspective floating UI panels, particle effects, spring animations, and cinematic pacing. Built on Remotion with Imagen 4.0 for frames and Veo 3.1 for B-roll. Use when: (1) creating a product demo or launch video, (2) showcasing a UI/app/tool with cinematic polish, (3) building a social-ready video from screenshots and renders, (4) applying the liquid glass floating panel style, (5) composing Remotion videos with 3D transforms and spring animations. Triggers on: 'launch video', 'product video', 'liquid glass video', 'demo video', 'showcase video', 'remotion video', 'floating panel', 'glass aesthetic'.

相关技能