Communitygithub.com

delorenj/skills

使用ElevenLabs AI生成专业配音。适用于需要为视频、音频解说或文本转语音内容创建配音的场景。支持多种角色预设(叙述者、销售员、专家)以实现自然的语音交付。包含单场景重新生成以进行微调。

skills 是什么?

此技能通过ElevenLabs API生成专业的AI配音,主要用于Remotion视频制作。它支持从单个文本片段到复杂场景序列的多种生成模式,并提供了丰富的角色预设(如叙述者、销售员、专家),使配音更自然,避免机械的逐字朗读。技能核心亮点在于“请求拼接”(request stitching)功能,可保持跨场景语音的一致韵律,以及针对单个场景的重新生成能力,无需重做整个项目。此外,它还集成了自动时序验证,能检测音频长度差异、前后静音和语速问题,并将实际时长回写到info.json中,方便与Remotion组件精确同步。支持缩略图嵌入,可将自定义图片嵌入MP4视频,提升在社交媒体和播放器中的展示效果。该技能适用于CLI工具,需要设置`ELEVEN_API_KEY`环境变量。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/delorenj/skills/tree/HEAD/elevenlabs-remotion

在你喜欢的 AI 中提问

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

文档

ElevenLabs 配音生成

使用ElevenLabs API为Remotion视频生成专业AI配音。

前提条件

  • .env.local 文件中设置 ELEVEN_API_KEY

快速开始

# 从文本生成配音
node ~/.agents/skills/elevenlabs-remotion/generate.js --text "您的文本在此" --output public/audio/voiceover.mp3

# 使用叙述者风格生成(更自然)
node ~/.agents/skills/elevenlabs-remotion/generate.js --text "您的文本" --character narrator --output voiceover.mp3

# 通过请求拼接生成场景
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes remotion/scenes.json --output-dir public/audio/project/

# 重新生成单个场景
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes scenes.json --scene scene2 --new-text "更新后的文本"

# 列出可用语音和角色预设
node ~/.agents/skills/elevenlabs-remotion/generate.js --list-voices
node ~/.agents/skills/elevenlabs-remotion/generate.js --list-characters

角色预设

使用角色预设可获得更自然的配音,避免逐字朗读屏幕文本:

角色描述最佳用途
literal完全按书面文本朗读屏幕文本、引语
narrator专业讲故事者,流畅且引人入胜解说、纪录片
salesperson热情、有说服力、充满活力营销、广告
expert权威、自信、知识渊博法律内容、教程
conversational随意、友好、自然社交媒体、休闲内容
dramatic强烈、情绪化、有冲击力钩子、问题陈述
calm舒缓、令人安心、温和建立信任、结尾
# 全局使用叙述者风格
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes scenes.json --character narrator --output-dir public/audio/

# 或在 scenes.json 中按场景设置
{
  "scenes": [
    { "id": "scene1", "text": "问题陈述", "character": "dramatic" },
    { "id": "scene2", "text": "解决方案", "character": "calm" }
  ]
}

基于场景的生成与请求拼接

使用ElevenLabs请求拼接功能,生成多个具有一致韵律的场景:

scenes.json 格式

{
  "name": "product-demo",
  "voice": "George",
  "character": "narrator",
  "scenes": [
    {
      "id": "scene1",
      "text": "通用文本转语音听起来很机械。您的品牌值得更好的。",
      "duration": 4.5,
      "character": "dramatic"
    },
    {
      "id": "scene2",
      "text": "通过语音克隆,您可以使用自己的语音创建无限内容。",
      "duration": 5.5
    },
    {
      "id": "scene3",
      "text": "录制一个简短样本。克隆它。几分钟内创建专业配音。",
      "duration": 6,
      "delay": 0.3
    }
  ]
}

生成所有场景

node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/product-demo-scenes.json \
  --output-dir public/audio/product-demo/

这会创建:

  • product-demo-scene1.mp3 到 sceneN.mp3
  • product-demo-combined.mp3(所有场景拼接)
  • product-demo-info.json(包含时长的元数据)

单场景重新生成

如果场景开始过早、时序错误或需要不同文本:

# 用新文本重新生成 scene2
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene2 \
  --new-text "更新后的场景2文本" \
  --output-dir public/audio/project/

# 用不同角色重新生成 scene3
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene3 \
  --character salesperson \
  --output-dir public/audio/project/

# 仅重新生成(相同文本、相同角色)
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene1 \
  --output-dir public/audio/project/

# 将缩略图嵌入MP4视频
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/my-video.mp4 \
  --thumbnail public/videos/my-thumbnail.png \
  --output public/videos/my-video-with-thumb.mp4

该工具自动:

  • 使用先前场景的请求拼接以实现一致的韵律
  • 用新元数据更新 info.json 文件
  • 如果提供了 --new-text,则更新 scenes.json

缩略图嵌入

将缩略图嵌入MP4视频,使Twitter、YouTube等播放器显示自定义缩略图,而非第一帧。

将缩略图嵌入视频

# 基本用法 - 输出到 video-thumb.mp4
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/promo.mp4 \
  --thumbnail public/videos/thumbnail.png

# 自定义输出路径
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/promo.mp4 \
  --thumbnail public/videos/thumbnail.png \
  --output public/videos/promo-final.mp4

与Remotion的工作流

# 1. 渲染视频
npx remotion render MyVideo public/videos/my-video.mp4

# 2. 渲染缩略图(使用Still组件)
npx remotion still MyVideoThumbnail public/videos/my-thumbnail.png

# 3. 嵌入缩略图
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/my-video.mp4 \
  --thumbnail public/videos/my-thumbnail.png \
  --output public/videos/my-video-final.mp4

支持的格式

  • 视频: MP4 (H.264/H.265)
  • 缩略图: PNG, JPG, JPEG

嵌入使用ffmpeg的 -disposition:v:1 attached_pic 标志将缩略图设置为附加图片,大多数视频播放器和平台都能识别。

时序验证

该技能会在生成后自动使用 ffprobe 验证时序:

检查项

检查项阈值描述
时长不匹配>15%实际时长与预期时长差异过大时发出警告
前导静音>200ms音频开始过晚(配音延迟)
尾部静音>500ms结尾不必要的静音
语速2-4.5 字/秒最佳约3字/秒

验证现有音频

# 验证项目中的所有场景
node ~/.agents/skills/elevenlabs-remotion/generate.js --validate public/audio/product-demo/

输出示例:

🔍 正在验证 product-demo(6个场景)

❌ scene1: 3.00s(预期:4.5s)
   ❌ 音频比预期短1.50s
   👍 8个字 @ 3.1字/秒
⚠️ scene2: 6.35s(预期:5.5s)
   ⚠️ 前导静音:235ms(可能开始过晚)
   🐢 10个字 @ 1.8字/秒
✅ scene4: 4.36s(预期:4s)
   👍 9个字 @ 2.3字/秒

📊 总时长:30.80s(预期:30.00s)

更新后的 info.json

验证后,info.json 包含实际测量值:

{
  "scenes": [
    {
      "id": "scene1",
      "duration": 4.5,
      "actualDuration": 3.0,
      "leadingSilence": 0.05,
      "wordsPerSecond": 3.1
    }
  ]
}

在Remotion组件中使用 actualDuration 以实现精确同步。

选项

选项描述默认值
--text, -t要转换为语音的文本必需(或 --file/--scenes)
--file, -f从文件读取文本-
--output, -o输出文件路径output.mp3
--output-dir场景的输出目录public/audio
--voice, -v语音名称或IDGeorge
--model, -m模型IDeleven_multilingual_v2
--character, -c角色预设literal
--scenes包含场景的JSON文件-
--scene重新生成的单个场景ID-
--new-text用于场景重新生成的新文本-
--validate验证现有音频目录-
--skip-validation跳过自动验证false
--embed-thumbnail要嵌入缩略图的视频文件-
--thumbnail缩略图文件(PNG/JPG)-
--stability语音稳定性(0-1)因角色而异
--similarity语音相似度(0-1)因角色而异
--style风格夸张程度(0-1)因角色而异
--no-combined跳过合并文件false

推荐语音

语音风格最佳用途
George温暖、迷人的英式旁白、解说
Antoni专业、温暖法律内容、教程
Arnold权威、深沉企业、严肃主题
Josh友好、健谈营销、休闲内容

与Remotion集成

生成场景配音后,在您的组件中使用:

import { Audio, Sequence, staticFile } from "remotion";

// 使用单个场景音频文件实现精确同步
const SCENE_DURATIONS = {
  scene1: 4.5,  // 来自 info.json
  scene2: 5.5,
  scene3: 8.0,
};

export const VideoWithVoiceover: React.FC = () => {
  const { fps } = useVideoConfig();

  const scene1Frames = Math.round(SCENE_DURATIONS.scene1 * fps);
  const scene2Frames = Math.round(SCENE_DURATIONS.scene2 * fps);

  return (
    <>
      <Sequence from={0} durationInFrames={scene1Frames}>
        <Audio src={staticFile("audio/project/project-scene1.mp3")} />
        <Scene1Visual />
      </Sequence>

      <Sequence from={scene1Frames} durationInFrames={scene2Frames}>
        <Audio src={staticFile("audio/project/project-scene2.mp3")} />
        <Scene2Visual />
      </Sequence>
    </>
  );
};

最佳实践技巧

  1. 使用角色预设:不要逐字朗读屏幕文本——使用 narrator 或 expert 实现自然流畅
  2. 标点很重要:使用句号表示停顿,逗号表示短暂休息
  3. 数字:写出数字以自然发音("五百" 而非 "500")
  4. 缩写:写出完整单词("二十四小时" 而非 "24h")
  5. 逐场景处理:不同场景可以使用不同角色(戏剧性的开场,平静的行动号召)
  6. 微调:使用 --scene 重新生成单个场景,无需重做所有内容
  7. 请求拼接:保持所有场景的语音一致性

工作流示例

# 1. 使用脚本创建 scenes.json
# 2. 以叙述者风格生成所有场景
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/my-video-scenes.json \
  --character narrator \
  --output-dir public/audio/my-video/

# 3. 在Remotion中预览,注意到 scene2 开始过早
# 4. 仅重新生成 scene2,使用更新后的文本
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/my-video-scenes.json \
  --scene scene2 \
  --new-text "稍长一些的文本以填充视觉时序" \
  --output-dir public/audio/my-video/

# 5. 使用 info.json 中的新时长更新视频组件
# 6. 重复直到时序完美

Individual skills in this repo

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

delorenj/skills

Plan and generate terminal ASCII animations/screensaver-style output (FPS, refresh rules, loop policy, low-flicker guidance), with a static poster frame and an optional local demo script.

delorenj/skills

ASCII video: convert video/audio to colored ASCII MP4/GIF.

delorenj/skills

Plan, build and quality-check a premium short commercial for a real business (roofing, property, ecommerce, B2B software) using AI-generated footage, code-built motion (HTML/GSAP), selective Three.js and an independent-critic "Gauntlet" loop. Use when asked to make a launch-style / SaaS-style video, business ad, explainer, sample reel or pitch video, or to review and improve one. Encodes motion principles distilled from 28 professional launch films, a quality bar, audio rules and a business-offer playbook.

delorenj/skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

delorenj/skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

delorenj/skills

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

delorenj/skills

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

delorenj/skills

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

delorenj/skills

Manim CE animations: 3Blue1Brown math/algo videos.

delorenj/skills

Join a Google Meet or Zoom call as a video meeting agent via PikaStreaming. Trigger: user drops a Google Meet or Zoom link, or asks to join a meeting.

delorenj/skills

Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames (e.g. "port my Remotion project to HyperFrames"). Do NOT use when (a) authoring a NEW HyperFrames composition (even if A/B-testing a Remotion video); (b) Remotion is mentioned in passing; (c) Remotion code is shared as reference, not for translation; (d) the user wants "the same video as my Remotion one" without explicitly asking to migrate the source — treat as a fresh HyperFrames build. When in doubt, default to the `hyperframes` skill. Detects unsupported patterns (useState, useEffect side effects, async calculateMetadata, third-party React component libraries, `@remotion/lambda`) and recommends the runtime interop escape hatch instead of a lossy translation.

delorenj/skills

Generate speech using the self-hosted voxxy (vox) TTS service at https://vox.delo.sh. Use when the user asks to speak, say, narrate, synthesize speech, clone a voice, create a voice, add or register a voice, pipe TTS, or control voice qualities by description (e.g. "a young woman with a cheerful voice"). Handles HTTP API usage, voice profile management, description-based voice design, cloning, MCP registration, and integration patterns for new platforms.

delorenj/skills

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

delorenj/skills

YouTube transcripts to summaries, threads, blogs.

相关技能