Communitygithub.com

iamaanahmad/voiceover-tts

テキスト読み上げ(ElevenLabs、OpenAI TTS、Kokoro、Piper)でナレーションを生成・タイミング調整、または録音音声の準備を行います。スクリプト準備、シーンごとの音声ファイル、ペーシング、発音、クリーンアップ、ラウドネスを扱います。ユーザーがナレーション、吹き替え、音声クローンのガイダンスを必要とする場合に使用します。

voiceover-tts とは?

このスキルは、AIエージェント(Claude Code、Cursor、Codexなど)向けに設計されており、ビデオやマルチメディアプロジェクトで使用するボイスオーバー(ナレーション)とテキスト読み上げ(TTS)の全文管理を自動化します。ElevenLabs、OpenAI TTS、Kokoro(ローカル)、Piper(ローカル)など複数のエンジンをサポートし、クラウドAPIとローカル実行の両方に対応。スクリプトの準備(数字・略語の読み上げ形式への変換、発音リスト作成)、シーンごとの音声ファイル分割、ffprobeを使ったワードレート計測・調整、ffmpegを使った録音音声のノイズ除去・圧縮・ラウドネス正規化、さらには無音トリミングや0.4秒ギャップでの結合までをワンストップで実行できます。APIキーは環境変数や.gitignore対象の.envファイルで安全に管理し、倫理的ガイドライン(同意のある音声クローンのみ使用、合成音声の開示、商用ライセンス確認)も提供。最終出力は音声ミキシングや字幕生成スキルと連携可能です。

対応~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/iamaanahmad/agents-video-editing-skills/tree/HEAD/skills/voiceover-tts

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ボイスオーバーとTTS

ボイスオーバーがタイムラインを動かします。ビジュアルを作成する前に生成します。

エンジンを選ぶ

エンジン配置強み注意点
ElevenLabsクラウドAPI最も自然な音質、音声クローン有料、同意のある声のみクローン可
OpenAI TTSクラウドAPIシンプル、安定音声の選択肢が限られる
Kokoroローカル無料、高品質、オフラインPythonのセットアップが必要
Piperローカル高速、CPUで動作表現力がやや劣る
録音音声マイク最も本物らしいクリーンアップが必要

APIキーは環境変数または.envファイル(gitignore対象)に保存します。絶対に表示やコミットをしないでください。

スクリプトを音声用に準備する

  • 数字、単位、略語は発音される形で書く:「twenty twenty-six」、「A P I」(綴る場合)、「gigabytes」。
  • 呼吸のためにカンマを入れ、停止にはピリオドを使う。括弧は避ける。
  • 難しい名前は発音リストにまとめ、短いサンプルで先にテストする。
  • シーンごとに1ファイルに分割する(audio/scene-01.mp3)。シーンごとのファイルなら、1行だけ再録音でき、タイミングの柔軟性が保てる。

生成(例:ElevenLabs REST)

import os, requests, pathlib

def tts(text: str, voice_id: str, out: pathlib.Path) -> None:
    r = requests.post(
        f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
        headers={"xi-api-key": os.environ["ELEVENLABS_API_KEY"], "Accept": "audio/mpeg"},
        json={"text": text, "model_id": "eleven_multilingual_v2",
              "voice_settings": {"stability": 0.5, "similarity_boost": 0.75}},
        timeout=120,
    )
    r.raise_for_status()
    out.write_bytes(r.content)

モデル名やエンドポイントは変更されることがあります。使用前にプロバイダの最新ドキュメントで確認してください。

計測とペーシング

ffprobe -v error -show_entries format=duration -of default=nw=1:nk=1 audio/scene-01.mp3
  • 目標は1分あたり140~160語(語数 / 秒数 * 60)。シーンが180語/分を超える場合は、少し異なる読み上げで再生成するか、テキストをトリミングする。早口に聞こえます。
  • 音声を約10%以上タイムストレッチしないでください。合成臭くなります。代わりに書き直しましょう。

録音音声のクリーンアップ

# ハイパス、軽いノイズリダクション、コンプレッション、ラウドネス
ffmpeg -i raw.wav -af "highpass=f=80,afftdn=nf=-25,acompressor=threshold=-18dB:ratio=3:attack=5:release=80,loudnorm=I=-16:TP=-1.5:LRA=11" -ar 48000 clean.wav

先頭と末尾の無音をトリミング:

ffmpeg -i in.wav -af "silenceremove=start_periods=1:start_threshold=-45dB,areverse,silenceremove=start_periods=1:start_threshold=-45dB,areverse" out.wav

結合

# 0.4秒のギャップを入れてシーンファイルを結合
python - <<'PY'
import subprocess, pathlib
files = sorted(pathlib.Path("audio").glob("scene-*.mp3"))
parts = []
for i, f in enumerate(files):
    parts += ["-i", str(f)]
n = len(files)
filt = "".join(f"[{i}:a]apad=pad_dur=0.4[a{i}];" for i in range(n)) + "".join(f"[a{i}]" for i in range(n)) + f"concat=n={n}:v=0:a=1[out]"
subprocess.run(["ffmpeg", "-y", *parts, "-filter_complex", filt, "-map", "[out]", "voiceover.mp3"], check=True)
PY

その後、audio-mixingで音楽とミックスし、captions-subtitlesでキャプションを付けます。

倫理と権利

  • 話者の明示的な許可がある場合のみ音声をクローンしてください。
  • プラットフォームのルールや法律で要求される場合は、合成音声であることを開示してください。
  • TTSプロバイダのライセンスで商用利用が許可されているか確認してください。

Individual skills in this repo

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

iamaanahmad/captions-subtitles

Create, edit, translate and burn in captions and subtitles - transcribe speech with Whisper, write SRT/VTT/ASS files, style them, and hard-burn word-highlight captions for Shorts, Reels and TikTok. Use for any captioning, subtitle, transcript or accessibility request.

iamaanahmad/ffmpeg-essentials

Core FFmpeg and ffprobe recipes for trimming, joining, converting, resizing, compressing, speed changes, fades, audio extraction and GIF conversion. Use for any direct media transformation task, or when a video will not play, has odd dimensions, or is out of sync.

iamaanahmad/motion-design-craft

Motion design rules for programmatic and edited video - durations, easing, springs, staggering, read time for on-screen text, beat grids, transitions and visual hierarchy, plus the defaults that make a video look AI-generated. Use when animating scenes, choosing timings, or reviewing a video that feels off.

iamaanahmad/moviepy-python-video

Compose and edit video in pure Python with moviepy 2.x - overlay text, lower thirds and captions on footage, cut and join clips, add audio, build short single-file build.py videos without Node. Use when the user wants Python-based video editing or deterministic text over AI-generated video.

iamaanahmad/remotion-programmatic-video

Build videos as React code with Remotion - compositions, sequences, springs, interpolation, audio sync, data-driven props, studio preview and rendering to MP4. Use for explainers, product demos, release notes, data charts, branded templates, or any video that should be reproducible from code.

iamaanahmad/screen-recording-demos

Record clean product and web app demos - scripted browser recording with Playwright, cursor and zoom polish, speed ramps, trimming dead time and syncing to narration. Use when the user wants a walkthrough, tutorial, UI demo or release video of a web app, or a repeatable recording.

関連スキル