Moviepy : Mix multiple audio files

2.4k Views Asked by At

I want to mix multiple audio files and export single audio file, to demonstrate, here's a example timeline;

audio1 : -----------------------------------------------------------------------

audio2 :      ===============

audio3 :                                   +++++++++++

audio4 :                                                         ************

audio5 :                                                     ~~~~~~~~~

I have the delay times, like, audio2 should be played with 2 seconds delay after audio1 is played and etc. How can I mix these AudioFileClip()?

1

There are 1 best solutions below

3
On BEST ANSWER

Use CompositeAudioClip with clip.set_start().

In a single line, you could do mixed = CompositeAudioClip([audio1, audio2.set_start(2), audio3.set_start(7)]). If you have complicated start times or other effects that you wish to apply, you can of course break it out into more lines.