Created
December 28, 2022 17:07
-
-
Save zironycho/7a0cc5f787629fdacc942cacb7786413 to your computer and use it in GitHub Desktop.
merge two audio with silence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydub import AudioSegment | |
audio1 = AudioSegment.from_wav('/path/to/input1.wav') | |
audio2 = AudioSegment.from_wav('/path/to/input2.wav') | |
# 0.3s silence | |
silence = AudioSegment.silent(duration=300) | |
output = audio1 + silence + audio2 | |
output.export('/path/to/output.wav', format='wav') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment