Phase 4: Audio & Music Generation · 45 min · Python · pydub · librosa
Audio Post-Processing & Mastering
Normalization, mixing, mastering — making generated audio production-ready is an engineering discipline, not an afterthought.
Hiring signal: Audio post-processing (normalization, mixing, mastering, format conversion) demonstrates you understand the full audio delivery pipeline, not just generation.
What you will learn
- Implement audio normalization: loudness standarding (LUFS), peak normalization
- Mix multiple audio tracks: balancing dialogue, music, SFX levels
- Apply mastering: EQ, compression, stereo widening for final polish
- Handle format conversion and delivery: WAV master, MP3/Opus for streaming
The Problem
A team generates audio for a product video: background music from Stable Audio, narration from ElevenLabs TTS, and SFX from Stable Audio Open. They merge them all at their default volumes. The result is unlistenable:
- The music is too loud — it drowns out the narration
- The SFX peaks clip — causing distortion
- The overall loudness is inconsistent — quiet in some parts, loud in others
- The final MP3 sounds different on different devices
They need audio post-processing: normalization, mixing, and mastering to make the audio production-ready.
What you'll build
Implement audio normalization (LUFS and peak), mix multiple audio tracks (dialogue, music, SFX) with proper level balancing, apply mastering (EQ, compression), and handle format conversion for delivery.
Audio Normalization
Peak Normalization
Peak normalization adjusts the audio so the loudest peak reaches a target level:
from pydub import AudioSegment
from pydub.effects import normalize
# Peak normalize to -1 dBFS (max peak at -1dB)
audio = AudioSegment.from_file("generated_audio.wav")
normalized = normalize(audio, headroom=1.0) # 1dB headroom
normalized.export("normalized.wav", format="wav")
LUFS Normalization (Loudness Standard)
LUFS (Loudness Units Full Scale) is the broadcast standard for loudness:
| Standard | Target LUFS | Use Case |
|---|
| EBU R128 | -23 LUFS | European broadcast |
| ATSC A/85 | -24 LUFS | US broadcast |
| Spotify | -14 LUFS | Music streaming |
| YouTube | -14 LUFS | Video platform |
| Apple Music | -16 LUFS | Music streaming |
| Podcast | -16 LUFS | Podcasts |
import subprocess
def normalize_lufs(input_path: str, output_path: str, target_lufs: float = -14):
"""Normalize audio to target LUFS using FFmpeg."""
subprocess.run([
"ffmpeg", "-y", "-i", input_path,
"-af", f"loudnorm=I={target_lufs}:TP=-1.5:LRA=11",
output_path,
])
You're producing audio for YouTube. What LUFS level should you normalize to?
YouTube normalizes audio to -14 LUFS. If your audio is louder, YouTube will turn it down. If quieter, YouTube may turn it up (but with potential artifacts). Normalizing to -14 LUFS before upload ensures your audio sounds as intended on YouTube. Different platforms have different targets: Spotify (-14), Apple Music (-16), broadcast (-23/-24).
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Mixing Multiple Tracks, Mastering, Format Conversion for Delivery, Complete Post-Processing Pipeline, Key Takeaways, What's Next — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy