Communitygithub.com

OmniVoice 語音工作室

透過 OmniVoice Studio MCP 伺服器提供本地 TTS、語音複製、語音設計與影片配音功能(開放原始碼的 ElevenLabs 替代方案;資料不離開機器,支援 MPS/CUDA/CPU)。

OmniVoice 語音工作室 是什麼?

OmniVoice 是一套完整的本地語音合成技能,作為開放原始碼的 ElevenLabs 替代方案,確保所有音訊處理皆在本機端完成,無需 API 金鑰或雲端費用。技能提供 `generate_speech`、`list_voices`、`list_personalities`、`list_languages` 與 `check_health` 等 MCP 工具,可將文字轉換為 646 種語言(ISO 639 代碼或自動偵測)、從 3 至 10 秒的參考片段複製語音、透過性別/年齡/口音/音高/風格描述詞設計語音,並支援批次處理與內容管線。核心取樣模型 (~2.4 GB) 首次使用時從 HuggingFace 下載並快取,支援 MPS/CUDA/CPU 加速。技能同時提供 macOS 腳本 `record-reference.sh`,透過音頻提示(`say` 與系統提示音)引導使用者錄製乾淨的語音複製片段,並透過 `silenceremove` 與 `atrim` 自動修剪。若使用者僅需快速英文旁白,建議使用 `kokoro-tts`(更輕量);若需最高品質且不計成本,則建議 ElevenLabs。

相容平台~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        # exit 0 if up
scripts/start-backend.sh       # boot in background (MPS/CUDA auto-detected)

首次合成呼叫時會延遲下載 k2-fsa/OmniVoice 模型(約 2.4 GB)來自 HuggingFace — 後續啟動時會快取。

任務索引 — 選擇正確的工具

任務工具備註
確認後端正在執行check_health回傳 `{"status":"ok","device":"mps
文字 → 音訊(使用已儲存的語音)generate_speech(text, profile_id)回傳 base64 WAV。profile_id="demo0001" 是內建的示範語音
文字 → 音訊(不進行語音複製,語音設計)generate_speech(text, instruct="…")省略 profile_id;傳入 instruct 如 "溫暖的中年女性旁白,平靜的語氣"
多語言旁白generate_speech(text, language="es")任何 ISO 639 代碼或 "Auto"
列出現有語音list_voices回傳 id、name、type、personality
列出人格預設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. 使用示範語音進行一次性旁白

# As called through the MCP client (your agent will do this for you):
result = generate_speech(
    text="你好 — 這是 OmniVoice 在本機端產生語音。",
    profile_id="demo0001",
    language="English",
    steps=16,                   # 8 = fast/draft · 16 = balanced · 32 = quality
)
# result is JSON with 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)            # parse JSON the tool returns
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 伺服器不公開 profile 建立功能 — 它僅讀取現有 profile。有兩種方式可建立:

方式 A — 內建輔助腳本(macOS,建議用於新語音複製):

scripts/record-reference.sh ~/Downloads/my-ref.wav 12 1
# args: output_path raw_duration_sec mic_index
# 預設 mic_index=1(MacBook 內建麥克風);列出裝置請使用:
#   ffmpeg -f avfoundation -list_devices true -i ""

該腳本透過 macOS say 及 /System/Library/Sounds/Ping.aiff 提供可聽見的倒數與開始/結束提示,讓使用者知道何時說話(終端機 stdout 有緩衝 — 文字提示「請說話」到達太晚)。它會錄製較長的原始視窗,然後透過 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   # max should be > -20 dB
afplay ref.wav

POST 到 /profiles(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
# returns { "id": "abc12345", "name": "carlos-clone" }

建立後,將 profile_id 傳遞給 generate_speech(透過 MCP)或直接透過 POST /generate。Profiles 會持久儲存於 SQLite 及參考音訊檔案 ~/Library/Application Support/OmniVoice/voices/<id>.<ext>(後端保留上傳的副檔名 — 若上傳 WAV 則為 .wav、MP3 則為 .mp3 等)。狀態在後端重啟後仍會保留。

明顯影響品質的參考片段技巧:

因素為何重要
單一說話者混合說話者會模糊嵌入
乾淨語音,無音樂/噪音模型也會嵌入噪音
自然韻律(避免拗口句子)擴散取樣會複製韻律,而不僅是音色
3-10 秒是最佳區間< 3 秒缺乏資訊;> 10 秒增加計算量卻無品質增益
ref_text 要與錄製內容一致改善對齊,尤其在噪音參考片段時
language 設定正確錯誤語言 → 跨語言轉換產生物件
響度峰值 ≥ -15 dB音量小的參考片段可運作但歸一化效果較差

4. 語音設計(無需參考片段)

省略 profile_id;提供描述目標語音的 instruct 字串:

generate_speech(
    text="歡迎來到代理系統的未來。",
    instruct="溫暖的中年女性旁白,沉穩權威的語氣,紀錄片風格",
)

可透過 list_personalities 取得預製的 instruct 字串,並複製符合需求的項目(narrator、casual、news-anchor 等)。

5. 影片配音(僅限網頁 UI)

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'.

相關技能