Skip to content

Instantly share code, notes, and snippets.

@Dobby233Liu
Created August 13, 2024 08:41
Show Gist options
  • Save Dobby233Liu/c96f770dab66b9ef00eb1d58d5a67824 to your computer and use it in GitHub Desktop.
Save Dobby233Liu/c96f770dab66b9ef00eb1d58d5a67824 to your computer and use it in GitHub Desktop.
whaaat
from pydub import AudioSegment
from itertools import islice
def batched(iterable, n):
i = 0
while i < len(iterable):
yield iterable[i:i+n]
i += n
THRESOLD = 3000
song = AudioSegment.from_file("icepalace_boss loopfix2.flac")
newsong = song.empty()
for i in batched(song, THRESOLD):
print(i)
newsong += i.normalize(6)
newsong.export("mashup.ogg", format="ogg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment