mirror of
https://github.com/chev2/shitpost-video-generator.git
synced 2026-04-22 02:32:41 +00:00
Normalize all audio sources before applying effects
This commit is contained in:
parent
1f75d0189b
commit
2acdf266d6
1 changed files with 5 additions and 1 deletions
6
main.py
6
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue