Communitygithub.com

Zuhair-01/claude-skills-and-systems

使用火山引擎豆包语音 2.0 生成普通話及多語言配音。適用於創建中文語音旁白、使用者偏好豆包/火山引擎 TTS,或配音需附帶逐字時間戳元數據以製作字幕時。

claude-skills-and-systems 是什麼?

此技能整合了火山引擎(Volcengine)的豆包(Doubao)語音合成 2.0 服務,使 AI 智慧體(如 Claude Code、Cursor 等)能夠直接生成高品質的中文及多語言配音。它特別適合需要精準字幕時間戳的影片旁白、教學內容或任何需有聲輸出的場景。技能支援同步和非同步 API 端點,其中非同步端點會回傳包含句子與單詞時間戳的詳細 JSON 數據,是製作完美的逐字字幕的關鍵。透過簡單的環境變數設定(`DOUBAO_SPEECH_API_KEY`),使用者即可在程式碼中呼叫 `TTSSelector` 或直接使用 `DoubaoTTS` 類別來生成音頻。技能文件也提供了最佳實踐建議,如先試聽樣本、根據語義而非固定字元數來分組字幕、以及常見錯誤的排除指南,確保生成流程流暢且結果專業。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Zuhair-01/claude-skills-and-systems/tree/HEAD/skills/doubao-tts

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

豆包 TTS

需要在 .env 中設定 DOUBAO_SPEECH_API_KEY。 設定 DOUBAO_SPEECH_VOICE_TYPE 來指定預設語音,或透過工具傳遞 voice_id。

目前 API

使用新控制台的 API Key 流程:

X-Api-Key: ${DOUBAO_SPEECH_API_KEY}
X-Api-Resource-Id: seed-tts-2.0

不要對新控制台的 API Key 使用 X-Api-App-Id 和 X-Api-Access-Key。如果 API 返回 load grant: requested grant not found,可能是 Key 類型或認證標頭錯誤。

對於長篇影片旁白,建議使用非同步端點:

POST https://openspeech.bytedance.com/api/v3/tts/submit
POST https://openspeech.bytedance.com/api/v3/tts/query

這會回傳 audio_url 以及 sentences[].words[] 時間軸元數據,可用於建立字幕。

OpenMontage 使用方式

使用 TTS 選擇器生成:

from tools.audio.tts_selector import TTSSelector

result = TTSSelector().execute({
    "preferred_provider": "doubao",
    "text": "如果 AI 真的會改變未來,普通人到底該怎麼參與?",
    "voice_id": "zh_female_vv_uranus_bigtts",
    "output_path": "projects/my-video/assets/audio/narration.mp3",
    "speech_rate": 0,
    "enable_timestamp": True,
})

或直接呼叫供應商:

from tools.audio.doubao_tts import DoubaoTTS

result = DoubaoTTS().execute({
    "text": "短樣本試聽文本。",
    "voice_id": "zh_female_vv_uranus_bigtts",
    "output_path": "projects/my-video/assets/audio/doubao_sample.mp3",
})

該供應商會寫入:

  • output_path:下載的音頻檔案
  • metadata_path:完整的查詢回應 JSON,預設為 <output_path>.json

建議工作流程

  1. 在進行完整付費配音前,先生成一段 10-15 秒的樣本。
  2. 請使用者確認語音自然度、口音和速度。
  3. 只有在獲得批准後才生成完整的配音。
  4. 保留查詢 JSON。它是字幕時間軸的唯一事實來源。
  5. 從 sentences[].words[] 而非估算的文字長度來建立字幕。
  6. 在應用時間戳之前,先根據中文語義短語來分組字幕。不要只按固定字元數分割;這樣會破壞像是「在不押單個公司的情況下」或「可能會被慢慢稀釋」這類短語,影響理解。
  7. 除非使用者明確要求匹配先前的執行時間,否則讓影片時長跟隨已批准的語音節奏。

參數

  • voice_id:豆包 speaker / 語音類型。預設為 DOUBAO_SPEECH_VOICE_TYPE。
  • resource_id:對豆包語音 2.0 使用 seed-tts-2.0。
  • speech_rate:0 為正常速度,100 為 2 倍速,-50 為 0.5 倍速。
  • sample_rate:預設 24000。
  • enable_timestamp:預設為 true。
  • return_usage:預設為 true,在可用時請求使用量元數據。

預設不要傳遞 additions.explicit_language。某些端點/金鑰組合會拒絕 zh-cn 並返回 unsupported additions explicit language zh-cn。

對於平靜的中文解說影片,從 speech_rate: 0 開始。如果結果對於已批准的格式來說太長,請先製作一個短比較樣本(使用 speech_rate: 25 或 50),再重新生成完整配音。如果使用者偏好豆包的自然節奏,不要為了匹配先前供應商的時長而加速。

疑難排解

  • load grant: requested grant not found:Key 類型錯誤或認證標頭錯誤。對新控制台 API Key 使用 X-Api-Key。
  • speaker permission denied:語音 ID 錯誤或未獲授權使用所選資源。
  • quota exceeded:超過配額、生命週期字元數或並發數。
  • 缺少時間戳:確認 enable_timestamp: true,保留查詢 JSON,並確認所選端點回傳了 sentences。

安全性

切勿將 API Key 列印或寫入日誌、元數據、修補程式或專案成品中。.env.example 應僅包含空的變數名稱。

Individual skills in this repo

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

Zuhair-01/claude-skills-and-systems

Create AI avatar videos with precise control over avatars, voices, scripts, scenes, and backgrounds using HeyGen's v2 API. Use when: (1) Choosing a specific avatar and voice for a video, (2) Writing exact scripts for an avatar to speak, (3) Building multi-scene videos with different backgrounds per scene, (4) Creating transparent WebM videos for compositing, (5) Using talking photos as video presenters, (6) Integrating HeyGen avatars with Remotion, (7) Batch video generation with exact specs, (8) Brand-consistent production videos with precise control.

Zuhair-01/claude-skills-and-systems

Edit existing videos using AI — remix style, upscale, remove background, and add audio via fal.ai's hosted video models.

Zuhair-01/claude-skills-and-systems

Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.

Zuhair-01/claude-skills-and-systems

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

Zuhair-01/claude-skills-and-systems

Read-only queue dashboard for workspace-aware ship. (gstack)

Zuhair-01/claude-skills-and-systems

Generate HeyGen presenter videos via the v3 Video Agent pipeline — handles Frame Check (aspect ratio correction), prompt engineering, avatar resolution, and voice selection. Required for any HeyGen video generation. Replaces deprecated endpoints with v3. Use when: (1) generating any HeyGen video (via API or otherwise), (2) sending a personalized video message (outreach, update, announcement, pitch, knowledge), (3) creating a HeyGen presenter-led explainer, tutorial, or product demo with a human face, (4) "make a video of me saying...", "send a video to my leads", "record an update for my team", "create a video pitch", "make a loom-style message", "I want to appear in this video", "generate a HeyGen video", "make a talking head video". Accepts avatar_id from heygen-avatar for identity-first HeyGen videos, or uses a stock presenter. Returns video share URL + HeyGen session URL for iteration. Chain signal: when the user wants to create/design an avatar AND make a video in the same request, run heygen-avatar f...

Zuhair-01/claude-skills-and-systems

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

Zuhair-01/claude-skills-and-systems

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Zuhair-01/claude-skills-and-systems

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

相關技能