From 0271ff835cac768844cf8a53a1ea9da12608bd31 Mon Sep 17 00:00:00 2001 From: Chev Date: Mon, 26 Jan 2026 17:17:14 -0800 Subject: [PATCH] Further limit which audio sources can be duplicated 5 seconds -> 1 second, clips longer than this shouldn't be duplicated as they tend to overlap too much --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index ae1ca84..f17b1ce 100644 --- a/main.py +++ b/main.py @@ -171,7 +171,7 @@ with tqdm(desc="Compiling sounds", total=len(randomSounds)) as pbar: # the audio coming from the video clips newClip = newClip.with_volume_scaled(0.6) - if newClip.duration > 5: #for long clips + if newClip.duration > 1: randomDuration = rng.uniform(*audio_clip_times) # crop audio duration # if the audio is longer than the cropped duration, crop the audio at a random position if newClip.duration > randomDuration: @@ -181,6 +181,7 @@ with tqdm(desc="Compiling sounds", total=len(randomSounds)) as pbar: newClip = newClip.with_start(rng.uniform(0, finalVideo.duration-newClip.duration)) # move audio around video length audioObjects.append(newClip) + # only apply duplication to clips shorter than 1 second else: # Place to position the audio clip - could be anywhere from the final video's start all the way to its full duration clipPosition = rng.uniform(0, finalVideo.duration - newClip.duration)