Communitygithub.com

voice-mastering

Professional voice processing for video projects (Audio Engineering & Voice Mastering). Use it whenever a pipeline touches a voice or dialogue track — vlogs, Reels/Shorts, lectures, interviews, testimonials, voiceover, podcasts, HyperFrames voice files — for noise reduction (DeepFilterNet), phrase levelling, adaptive EQ, de-essing, compression, saturation, music ducking, two-pass loudness mastering, QC reports and loudness-matched A/B clips. Also for building a speaker's reference voice from their own recordings.

What is voice-mastering?

voice-mastering is a Claude Code agent skill that professional voice processing for video projects (Audio Engineering & Voice Mastering). Use it whenever a pipeline touches a voice or dialogue track — vlogs, Reels/Shorts, lectures, interviews, testimonials, voiceover, podcasts, HyperFrames voice files — for noise reduction (DeepFilterNet), phrase levelling, adaptive EQ, de-essing, compression, saturation, music ducking, two-pass loudness mastering, QC reports and loudness-matched A/B clips. Also for building a speaker's reference voice from their own recordings.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/karchebnyi/video-skills/tree/HEAD/voice-mastering

Ask in your favorite AI

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

Documentation

Voice Mastering

Goal: a full, clean, natural voice with balanced lows, mids and highs, and the same sound for the same speaker in every project.

Where things are

  • scripts/voice_master.py — the engine and CLI.
  • scripts/vm_dsp.py — light helpers (numpy, scipy, ffmpeg only), importable from any Python: read / write, ebur128, loudnorm_2pass, level_speech, duck_music, deess_dynamic, saturate.
  • presets/*.json — voice presets: premium_podcast (default), youtube_reels, cinematic_narration, natural_studio, educational_lecture.
  • presets/denoise/ — DeepFilterNet3 settings: medium (−24 dB, default), light (−12 dB), off (clean studio takes).
  • User data, outside the skill folder (updating the skill never touches it). Root: VIDEO_SKILLS_HOME, else %LOCALAPPDATA%\video-skills on Windows (C:\video-skills when the profile path is not ASCII), ~/.local/share/video-skills elsewhere:
    • voice-kits/<speaker>.json — reference voices, one per speaker;
    • voice-mastering.json — the default speaker of this machine;
    • cache/voice/ — DeepFilterNet results, keyed by file, size, mtime and settings (override with VM_CACHE).

Python

Use the skills' own environment, made by setup/setup.ps1 (or setup.sh) of the repository — Python 3.11, because DeepFilterNet has no wheels for 3.12+:

  • Windows: <root>\py311\Scripts\python.exe, e.g. %LOCALAPPDATA%\video-skills\py311\Scripts\python.exe;
  • macOS / Linux: <root>/py311/bin/python. If it is missing, tell the person to run the setup script; never install DeepFilterNet or torch into the system Python. Always run with -X utf8.

Commands

VM=<skills>/voice-mastering/scripts/voice_master.py
$PY -X utf8 $VM analyze  IN [--json OUT]
$PY -X utf8 $VM process  IN OUT.wav [--preset premium_podcast] [--speaker NAME | --brandkit KIT.json | --no-kit]
                         [--denoise medium|light|off] [--stem] [--lufs X] [--tp -1] [--channels 2|1] [--report DIR] [--ab-dur 20]
$PY -X utf8 $VM brandkit REF1 REF2 ... --speaker NAME [--default]
$PY -X utf8 $VM kits
$PY -X utf8 $VM mix      OUT.wav --voice V.wav --music M1 [M2 ...] [--preset youtube_reels] [--duck -11] [--music-under 10] [--sfx SFX.json] [--fps 25]
$PY -X utf8 $VM master   IN OUT.wav [--lufs -14] [--tp -1]
$PY -X utf8 $VM qc       FILE [--lufs -14] [--tp -1]
  • --stem: no loudness stage, for when the edit levels and masters the voice itself.
  • --channels 2 (default) masters to the stereo / video target of the preset; --channels 1 to its mono podcast target.
  • --report DIR writes report.md (in Russian), metrics.json, spectrum.png, spectrogram.png and A/B clips A — исходник / B — обработка (.wav and labelled .mp4) over the same speech-rich window, both levelled to −16 LUFS.
  • The original is never written to. Every output gets a .vm.json sidecar with the filters, decisions and denoise info; a file whose sidecar says denoised: true is never denoised again.

Reference voice: always the speaker's own

The chain nudges a recording's broad tonal balance towards a reference of the same person, so one speaker sounds alike across rooms, microphones and projects. It never pulls anyone towards somebody else's timbre.

  • Before processing, find out whose voice it is and run kits. If that speaker has a kit, pass --speaker NAME.
  • No kit for this speaker yet — and on the first use on a machine, for the person who works with this skill: build one first. Ask for (or pick from the project) 3–5 recordings of this speaker, from different rooms or days, 30–60 s of speech each, then brandkit ... --speaker NAME. Add --default when it is the machine owner's own voice, so it is used whenever no speaker is named.
  • Until a kit exists, process runs without a reference (--no-kit forces this): tone comes from the preset alone, only bumps over the recording's own smooth speech curve (mud, box) are trimmed, and the tonal check in the report is coarser. Say so in your reply.
  • Never use one person's kit for another person's voice. Kits are personal data: they stay in the user data folder and are never committed to git.

The chain (order)

  1. Analysis: integrated and short-term LUFS, RMS, true peak, LRA, speech dynamics, crest factor; noise floor and SNR; 50/60 Hz hum and harmonics, rumble below 60 Hz; resonances; sibilance index; clipping; RT60 estimate; band balance against 1–2 kHz, 1–8 kHz tilt, f0.
  2. DeepFilterNet (cached), medium by default. It is the only noise reducer: no afftdn or other denoisers on top.
  3. Analysis again on the cleaned voice; the EQ decisions use it.
  4. Phrase leveller (preset level): quiet and loud phrases are brought part-way to the speaker's typical level, at most ±4–6 dB; the gain holds through pauses, so breaths and room tone are not pumped up.
  5. Pre-gain: typical speech level to −20 dBFS.
  6. High-pass: preset corner, capped at 0.8 × the lowest f0; a second 80 Hz stage when rumble is found.
  7. Hum notches, only if hum is detected.
  8. Corrective EQ: mud 250–500 Hz, box 500–1000 Hz, up to 3 resonance notches.
  9. De-esser (ffmpeg deesser, mild), scaled by the sibilance index.
  10. Compressor: ratio 2–3.5, attack 10–20 ms, release 90–150 ms, threshold set for the preset's gain reduction at speech peaks.
  11. Tonal EQ: warmth 80–200 Hz, presence 2–5 kHz, air shelf 10–16 kHz. With a kit: preset value + half the deviation from the speaker's reference (firmer above 3 dB, at most ±3 dB per band, ±6 dB total). On a clean source (SNR ≥ 20 dB) half of the air the denoiser took is given back, at most 3 dB; on a noisy one that "air" was hiss and stays gone.
  12. Dynamic de-esser (5–9.5 kHz split band), only when the sibilance index is above 11.
  13. Saturation, light 2× oversampled parallel tanh, loudness-matched. Off in natural_studio and educational_lecture.
  14. Loudness: two-pass loudnorm to the preset target, then a 4× oversampled limiter, true peak ≤ −1 dBTP. 48 kHz, 32-bit float WAV.
  15. QC: the result is measured again and the remaining problems are listed; the preset's intended boosts are not counted as defects.

Mixing and mastering

  • Ducking (vm_dsp.duck_music): gate −42 dB, 80 ms attack, 700 ms release; the bed also dips −3 dB at 1–4 kHz while the speaker talks.
  • Music level in mix follows the voice: the bed is set --music-under LU (default 10) below the voice's measured loudness before ducking, whatever level the stem came in at.
  • SFX are snapped to the video frame grid; the report lists the frame each one lands on.
  • Loudness targets (in the presets): YouTube / Reels −14 LUFS; podcast −16 stereo / −19 mono; educational −16; cinematic −18. Always true peak ≤ −1 dBTP.
  • After the final encode, always run qc on the actual mp4 / m4a.

How to use it in a project

  • FFmpeg pipelines: process SRC OUT --stem --preset ... --speaker ... for the cleaned dialogue (cached), vm_dsp.duck_music for the bed, vm_dsp.loudnorm_2pass for the master.
  • HyperFrames: process each voice file assets/voice/<id>.wav into assets/voice/<id>.vm.wav with --stem, point the composition at the processed file and keep the original next to it; master the final render's audio with mix / master (or the media-use audio tools) plus qc.
  • Show results: send the A/B .mp4 clips to the person (they compare by ear; a bare m4a shows no player in chat), and ask before changing preset or denoise strength.
  • Preset choice: default premium_podcast; vertical shorts youtube_reels; lessons educational_lecture; documentary voiceover cinematic_narration; clean studio takes natural_studio with --denoise off. Change the preset only with a reason.

Rules

  • Keep the speaker's timbre, breath and articulation. Never accept a metallic, underwater or pumping sound: if one appears, switch to --denoise light or a lower compression before anything else.
  • Do not boost highs to fight a muffled source beyond what the chain decides; report it instead.
  • Use only music the project has the rights to.
  • Other people's voices are personal data: follow the project's privacy rules, and do not build a kit of someone without a reason tied to the project.
  • No paid services or external APIs; everything runs locally.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Related Skills