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:
- Video segments with native audio from Stage 3:
segments/{seg_id}.mp4; - High-quality standalone film score BGM:
assets/bgm/*.wav.
- Video segments with native audio from Stage 3:
- Output:
- Cleaned segments with bed noise removed:
cleaned_segments/{seg_id}.mp4; - Final video with 90s suspense/commercial soundtrack and intelligent sidechain ducking:
[Episode Name]_final_ducked.mp4; - ASR language & dialogue accuracy quality checklist.
- Cleaned segments with bed noise removed:
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:
- Extract the first 5 seconds of the audio track for Language ID detection;
- Pass Condition:
language == "zh"and confidenceprob >= 0.85; - Interception Action: If detected as
enor any other language, automatically throwLanguageDriftErrorand 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