Skip to content

Instantly share code, notes, and snippets.

@zironycho
Created December 28, 2022 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zironycho/7a0cc5f787629fdacc942cacb7786413 to your computer and use it in GitHub Desktop.
Save zironycho/7a0cc5f787629fdacc942cacb7786413 to your computer and use it in GitHub Desktop.
merge two audio with silence
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