Communitygithub.com

Drama Audio Soundstage

Short drama industrial pipeline · Stage 4: Sound engineering and intelligent ducking soundtrack. Responsible for audio refinement after H3 video generation. Hardcore practices: Spectral subtraction audio gating (eliminates wind noise/current bed noise), Whisper ASR Mandarin language drift interception, FFmpeg native sidechain dynamic ducking mixing (Sidechain Ducking: BGM drops -14dB instantly when dialogue starts, rises when silent).

What is Drama Audio Soundstage?

This skill is the fourth stage in an industrial-grade short drama production pipeline, focusing on sound engineering and intelligent soundtrack integration after H3 video generation. It provides three hardcore functionalities: spectral subtraction audio gating to remove continuous bed noise (like low-frequency hums, wind noise, or current noise) while preserving dialogue and transient sound effects; Whisper ASR-based Mandarin language drift interception to automatically detect and reject segments where character speech drifts into pseudo-English or garbled noise; and FFmpeg native sidechain dynamic ducking mixing, which uses the dialogue as a control signal to instantly lower BGM volume by -14dB during speech and smoothly restore it within 400ms after silence. The skill outputs cleaned video segments, a final mixed video with 90s suspense/commercial soundtrack ducking, and an ASR language/dialogue accuracy quality checklist. It is designed for developers using Python/FFmpeg on Windows or any OS supporting PowerShell, and is ideal for automated post-production pipelines for short-form dramas.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/abserari/drama-production-skills/tree/HEAD/skills/drama-audio-soundstage

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Drama Audio Soundstage (Sound Engineering & Intelligent Soundtrack Stage)

Stage Position: Short drama sound design and commercial soundtrack stage. No Generic Fluff: We do not explain what an audio track is. We only document audio gating cleanup parameters, language drift interception thresholds, and sidechain ducking mixing curves.


1. Runtime Contract & Input/Output

  • Input:
    1. Video segments with native audio from Stage 3: segments/{seg_id}.mp4;
    2. High-quality standalone film score BGM: assets/bgm/*.wav.
  • Output:
    1. Cleaned segments with bed noise removed: cleaned_segments/{seg_id}.mp4;
    2. Final video with 90s suspense/commercial soundtrack and intelligent sidechain ducking: [Episode Name]_final_ducked.mp4;
    3. ASR language & dialogue accuracy quality checklist.

2. Hardcore SOP: Spectral Subtraction Audio Gating

Problem: H3-generated audio often contains persistent low-frequency hums, false wind noise, or harsh environmental bed noise that ruins immersion. Goal: Completely remove continuous bed noise while preserving 100% of dialogue and short action sound effects (sword-draw, table-slap, footsteps).

2.1 Gating Core Parameters & Physical Meaning

When calling scripts/audio_gate.py, use the golden parameter set:

  • --bed-q 15: Time-domain sliding window percentile (set to 15th percentile) for precise identification of continuous background noise;
  • --alpha-bed 6.0: Deduction strength for continuous bed noise;
  • --alpha-fx 1.0: Protection factor for transient sound effects/dialogue; smaller values preserve dialogue better;
  • --fx-snr 4.0: SNR threshold for transient detection;
  • --quiet-gain 0.03: Attenuation factor for pure silent frames.

Command:

python scripts/audio_gate.py --in segments/seg01.mp4 --out cleaned_segments/seg01.mp4

3. Hardcore SOP: ASR Mandarin Language Drift Automated Interception

Problem: Character pronunciation drifts into pseudo-English, garbled code, or non-Chinese noise, severely affecting delivery quality.

3.1 Interception & Criteria

After writing to disk, run a quick Whisper language validation:

  1. Extract the first 5 seconds of the audio track for Language ID detection;
  2. Pass Condition: language == "zh" and confidence prob >= 0.85;
  3. Interception Action: If detected as en or any other language, automatically throw LanguageDriftError and mark the segment as failed, triggering a re-run with a different seed.

4. Hardcore SOP: Cinematic Sidechain Dynamic Ducking (Sidechain Ducking)

Anti-Pattern (Negative Example) : Never blindly lay BGM at a fixed volume under the video! The dialogue will be drowned by background music, resulting in zero commercial-grade layering.

4.1 FFmpeg Native sidechaincompress Golden Curve

Use the dialogue track as the sidechain control signal to dynamically suppress the BGM in real time:

  • BGM Base Level: bgm_volume = 0.35;
  • Threshold: ducking_threshold = 0.06 (action triggers ducking the moment the human voice appears);
  • Ducking Depth (Ratio) : ducking_ratio = 5.0 (when dialogue speaks, BGM instantly ducks approximately -14dB, leaving a completely clear frequency band for vocals);
  • Attack Time: ducking_attack_ms = 80ms (smooth ducking at the first word of dialogue, no harsh pops);
  • Release Time: ducking_release_ms = 400ms (after dialogue ends, the BGM smoothly recovers within 0.4 seconds, heightening tension).

Command:

python scripts/cinematic_audio_mixer.py --input concat_raw.mp4 --output final_ducked.mp4 --bgm assets/bgm/suspense.wav

Individual skills in this repo

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

comfy-h3-render-core

短剧工业化管线·第 3 工序:H3 物理视频渲染与防翻车调度。负责与本地 ComfyUI 服务交互,调度 MiniMax H3 进行 Turbo 8-step 视频生成。硬核沉淀:Windows WDDM 驱动锁防御、潜空间 32 整除铁律、单人发音锁定与全员闭嘴抑制指令装配、首帧 I2V 安全注入、分镜间显存防泄漏。

comfy-h3-video-producer

本地 ComfyUI 剧本转视频自动生产管线(MiniMax H3)。用户给剧本要求用 ComfyUI 出分镜视频,或提到"一采二采/超分/班长套件/CSGlide/工作流生成视频"时使用。覆盖:工作流握手(不写死节点号)、导演调度与段规划、H3 提示词、提交与自动监工、一采双检闸门、收片清床音与拼接、断点续产。

drama-director-staging

短剧工业化管线·第 1 工序:编剧与导演分镜调度。负责将剧情大纲或小说文本转化为符合短剧视听规律的工业级分镜。内置:6 大动态运镜轮换决策树、台词纯中文汉字归一化(数字大写)、短剧快节奏 20~28 字密度调控、单人发言与旁观者闭嘴标注。

drama-finishing-upscaler

短剧工业化管线·第 5 工序:终期成片与 1080p 超分增强。负责全集分镜无损拼接与院线级 1080p 超分辨率放大。硬核沉淀:FFmpeg concat 零损耗直拼、RealESRGAN x2plus GPU 独占 FP16 批量超分(~4.8fps)、原生高质量避让音轨无损混流、ffprobe 工业级物理参数验收。

drama-keyframe-forge

短剧工业化管线·第 2 工序:分镜定帧与资产一致性。负责在视频渲染前,建立全局风格母卡 (Style Bible),并为每个分镜前置生成“场景+人物+道具”三合一的 16:9 高清定帧垫图。彻底根治 T2V 盲跑带来的人脸变形、角色换脸、场景变色与道具软化。

Related Skills