From 2acdf266d61ca58beefe0bebcaaf1b558664b237 Mon Sep 17 00:00:00 2001 From: Chev Date: Mon, 26 Jan 2026 17:15:46 -0800 Subject: [PATCH] Normalize all audio sources before applying effects --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 118847c..ae1ca84 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ from sys import maxsize from os import listdir, mkdir, path # MoviePy modules -from moviepy import VideoFileClip, AudioFileClip, CompositeAudioClip, CompositeVideoClip, ImageClip, concatenate_videoclips, vfx, VideoClip +from moviepy import VideoFileClip, AudioFileClip, CompositeAudioClip, CompositeVideoClip, ImageClip, concatenate_videoclips, vfx, afx, VideoClip from src import custom_effects @@ -163,6 +163,10 @@ copiedSoundAmount = 0 with tqdm(desc="Compiling sounds", total=len(randomSounds)) as pbar: for index, audio in enumerate(randomSounds): newClip = AudioFileClip(audio) + + # Normalize the audio volume first + newClip = newClip.with_effects([afx.AudioNormalize()]) + # Modify the volume of audio clips so that they (hopefully) won't drown out # the audio coming from the video clips newClip = newClip.with_volume_scaled(0.6)