Communitygithub.com

長影片語音

為已核准的影片腳本建立口語音訊(旁白與角色配音)。先判斷影片是否需要語音並請使用者確認,然後建立配音陣容、製作聲音樣本,最後產生每個口語行對應的音訊檔案。

長影片語音 是什麼?

「長影片語音」是長影片工作流程的第七階段,負責為已核准的影片腳本產生完整的語音音訊,包括旁白與角色對白。它會依據腳本的語言、旁白模式(旁白、角色、混合)以及組態中的語音來源(自行錄製、雲端 TTS、本地 TTS)來決定是否需要語音。若是需要,它會先建立配音陣容(列出每位說話者及其行數與聲音描述),然後使用已連接的工具(如 ElevenLabs MCP)為每位說話者產生短樣本,待使用者核准後才正式生成所有音訊行。每個音訊檔案會根據場景編號與說話者命名,並儲存於 `audio/lines/` 資料夾中。它也支援使用者自行錄製或使用其他工具,並提供語音腳本批次或逐行進行的模式。此技能支援 Claude Code、Cursor 等開發工具,可與 `long-video-clips` 或 `long-video-keyframes` 銜接,最後將狀態更新至 `project.json`,並可選擇繼續進入音效與背景音樂階段。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-voice

在你喜歡的 AI 中提問

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

說明文件

長影片語音 是做什麼的?

長影片工作流程的第七階段。輸出:一個包含音訊檔案的資料夾,每個口語行一個檔案,按場景與說話者命名。或決定影片不需要語音。

場景是指腳本中的一個片段(一個鏡頭,最多 10 秒),按影片中的順序編號,與先前階段相同。

開始之前

  1. 在 ~/.long-video/projects/<slug>/ 中找到專案。需要 video-script.md 且其 status 為 approved,以及 film-style.md。
  2. 載入專案組態:語言、旁白來源與提供者(audio.voiceover)、providers.tts、核准層級、預算。
  3. 從 film-style.md 讀取說話模式與聲音描述。
  4. 如果 audio/ 或 voice-scripts/ 已存在,詢問:繼續(列出已完成內容)或重新開始。

步驟 1:影片是否需要語音?

先自行判斷再詢問。檢查:

  • film-style.md 中的說話模式(旁白、角色、混合),
  • 組態中的 audio.voiceover.source(none、self-recorded、cloud-tts、local-tts),
  • 腳本中包含多少旁白或對白行,以及分佈在多少場景中。

然後給出建議並附上理由,請使用者確認。例如:「腳本中有 142 行旁白,分佈在 104 個場景中的 96 個,且組態使用雲端文字轉語音。我建議使用有旁白的影片。您要我建立聲音嗎?」

  • 如果腳本中沒有口語行,或組態設為無旁白:建議跳過,並說明理由。
  • 已核准。 繼續執行步驟 2。
  • 不需要。 在 project.json 中設定 "voice_mode": "none" 和 "stage": "voice-skipped"。告知後續階段將僅使用音樂與音效。停止。
  • 不同意建議。 遵循使用者意願。如果原本語音設為 none 而使用者現在想要,則更新組態備註。

未經使用者確認,絕不擅自建立任何聲音。

步驟 2:建立配音陣容

  1. 列出每位說話者:旁白(如果有的話)以及每個有對白的角色。統計每人的行數。
  2. 對於每位說話者,從 film-style.md 取得聲音描述(年齡、語氣、口音、速度)。如果缺少描述,則從 visual-bible.md 的角色描述中提出一個,並標記為「建議」。
  3. 以表格呈現陣容:說話者、ID、行數、聲音描述。請使用者確認或編輯。
  4. 說話者 ID:narrator,或角色 ID 去掉 char- 前綴(例如 char-mara 變成 mara)。這些 ID 將用於檔案名稱。

步驟 3:選擇音訊製作方式

詢問:「要由 Claude 產生聲音,還是您自行製作(錄音或使用您自己的工具)?」

  • Claude 產生。 前往步驟 4。
  • 我自行製作。 前往步驟 6。
  • 兩者都做。 撰寫語音腳本(步驟 6)並同時產生(步驟 4)。
  • 如果 audio.voiceover.source 是 self-recorded,直接前往步驟 6。

步驟 4:尋找語音工具並製作樣本

閱讀 references/voice-generation.md。簡而言之:

  1. 如果組態中已儲存方法(providers.tts),則使用它。進行測試。
  2. 在本次工作階段中尋找已連接且能產生語音的工具(ElevenLabs MCP 或類似工具,或具有語音工具的技能)。
  3. 檢查裝置上的 API 金鑰環境變數。僅輸出「已設定」或「未設定」。
  4. 檢查本機文字轉語音工具。
  5. 如果找不到任何工具,詢問使用者是否有 API 金鑰(作為環境變數,切勿貼在聊天中)、可連接的 MCP 伺服器,或瀏覽器中的語音網站。或者前往步驟 6。

先製作聲音樣本。未經使用者核准聲音之前,絕不產生完整音訊。

  1. 為每位說話者挑選符合描述的聲音。列出工具的聲音並從中選擇。切勿使用記憶中的聲音 ID。如果工具可以根據描述設計新聲音,則為難以匹配的聲音提供此選項。
  2. 為每位說話者製作一個短樣本(5 到 15 秒)。使用該說話者在腳本中的實際台詞,語言為組態語言。對於旁白,使用開場台詞。如果台詞有表演說明,請一併加入。
  3. 將樣本儲存至 audio/samples/,檔名為 sample_<speaker>.mp3。
  4. 逐一呈現每個樣本,附上說話者、聲音名稱與台詞。請使用者核准,或要求換另一個聲音。如果使用者要求換聲音,則製作一個新樣本(一次一個,切勿批次重試)。重複直到每位說話者都獲得核准。
  5. 將核准的聲音記錄在 voice-cast.md 中(說話者、聲音名稱、聲音 ID、設定、樣本檔案)。更新 film-style.md 中的聲音清單以保持一致。

請勿重複執行產生呼叫來重試。每次呼叫都可能再次收費。

步驟 5:產生台詞

  1. 閱讀 references/voice-script-format.md。從腳本建立台詞清單:每個口語行一個項目,按場景順序排列。
  2. 告知使用者行數、總口語時間以及約略成本。開始前先詢問。提議從某個範圍開始,例如場景 1 到 10。
  3. 測試場景。 產生第一個有語音的場景。播放或回報其持續時間。詢問效果是否正確。先修正設定。
  4. 依照場景順序,僅使用已核准的聲音進行產生。套用表演說明。使用台詞清單中的發音註記。
  5. 將每個行儲存為 audio/lines/scene-<NNN>_<speaker>_<NN>.<ext>。未經詢問,絕不覆寫檔案。
  6. 每個檔案產生後,使用 ffprobe 測量其持續時間。與腳本中該場景的持續時間進行比較(請參閱格式參考中的符合規則)。記錄結果。
  7. 如果某一句話不符合其場景,請勿更改文字。提供選項:稍微加快語速(最多 10%)、延長場景時間(仍在 10 秒限制內),或經使用者核准後將台詞拆分到兩個場景中。
  8. 全部一次完成或逐個進行:詢問使用者。逐個進行時,會播放每個行的結果,等待核准或重做要求。
  9. 如果工具在影片剪輯中自行產生音訊(嘴型同步),詢問是要保留該音訊還是使用這些檔案。將答案記錄在 audio/status.md 中。

如果產生失敗或使用者拒絕,則對於剩餘場景,回退到步驟 6。

步驟 6:使用者的語音腳本

  1. 建立 audio/lines/ 用於存放完成的音訊檔案,以及 voice-scripts/ 用於存放台詞清單。顯示完整路徑。
  2. 撰寫包含 20 個場景的批次檔案(scenes-001-020.md)與 voice-scripts/index.md,遵循格式參考。每個行包含:
    • 要儲存的檔案名稱:audio/lines/scene-007_narrator_01.mp3
    • 說話者與聲音描述
    • 確切文字、表演說明與發音註記
    • 場景持續時間,以便檢查音訊是否符合
  3. 詢問:全部一次完成,或逐個進行。
    • 全部一次完成。 顯示資料夾路徑與一個範例。使用者自行處理批次檔案。
    • 逐個進行。 顯示第一個行及其檔案名稱。等待使用者告知已儲存。檢查該檔案是否存在且名稱正確,並測量其持續時間。然後顯示下一個行。
  4. 隨時提供檢查資料夾的選項:比對檔案與索引,並列出遺失、命名錯誤或太長的聲音。

步驟 7:狀態與完成

  1. 保持 audio/status.md 與格式參考中的表格一致。狀態值:pending、done、needs-manual、skipped。
  2. 更新 project.json:在台詞清單儲存後設定 "stage": "voice-prompts-done",在每個口語行都有音訊檔案且使用者核准該組時設定 "stage": "voice-done"。
  3. 告知使用者 audio/ 與 voice-scripts/ 的路徑、口語總時間與影片時間的比較,以及缺少或過長的內容。
  4. 提議將正在使用的工具儲存在組態中(providers.tts),僅限方法與名稱。
  5. 提議繼續進行 long-video-sound(音效、氛圍與背景音樂)。僅在使用者同意時才啟動。除非使用者要求且該階段存在,否則不要啟動任何後續階段。

規則

  • 未經使用者在步驟 1 中確認,絕不建立聲音。
  • 在聲音樣本核准之前,絕不產生完整音訊。
  • 絕不更改腳本文字。如果某一句話不符合,先詢問。
  • 絕不使用非來自工具自身聲音清單或使用者提供的聲音 ID。
  • 絕不在聊天中詢問 API 金鑰。絕不輸入密碼或解決瀏覽器中的 CAPTCHA。
  • 絕不默默地重複產生呼叫來重試。每次呼叫都可能再次收費。
  • 台詞清單核准後,絕不重新命名檔案。
  • 保持聊天訊息簡短。將完整的台詞清單放在檔案中。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-keyframes

Create the start and end frame image for every scene (clip) of the approved video script. Writes one image prompt per frame with a fixed file name that holds the scene number and start or end, makes a folder for the images, and can generate the images with an available image tool, or hand the prompts to the user all at once or one by one. Use after long-video-director, or when the user asks for start frames, end frames, keyframes or scene images.

long-video-render

Assemble the finished video and run the review loop. Builds the edit from the clips (or images with camera moves), voice, sound stems and captions, renders a low quality review version with scene numbers and time burned in so a client can review it, collects and applies changes (re-rendering reviews as often as needed), and when the user approves, renders the high quality final video. Uses a video editor with a CLI or MCP (FilmCraft, EffectCraft or another) if one is available and the user wants it, otherwise the bundled ffmpeg renderer. Use after long-video-sound, or when the user asks to render, assemble, export, preview or finalize the video.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

相關技能