1

At the moment, I use audacity to do it. However, I have 100s of such mp3 files which is needed. I was wondering if we can do it in Python?

from pydub import AudioSegment
sound = AudioSegment.from_mp3("C:/Users/s/Desktop/free/1.mp3")

# Concatenation
times = sound + sound + sound + sound + sound + sound 

# writing mp3 files is a one liner
times.export("C:/Users/s/Desktop/free/mp_1.mp3", format="mp3")

I tried this approach , but it fails if I try to add 5 1 hr mp3s. I wanna have a generic method, is this do-able in python?

LearnerJS
  • 298
  • 2
  • 14
  • I would just use `ffmpeg` and the `stream_loop` option to loop the input N times into the output. No need for Python. – vaizki Jan 31 '22 at 08:39
  • How can we do it? @vaizki A sample of that would be great. Also, 100+ files, how? – LearnerJS Jan 31 '22 at 08:40

0 Answers0