"I want to add silence for 1 second to the beginning of a file called b.wav !!"
from pydub import AudioSegment
a = AudioSegment.silent(duration=1000) #1 second
b = AudioSegment.from_file("b.wav")
c = a + b
c.export("ccc.wav",format='wav')
pip install pydub
If you get an error and cannot install See also the article "When pydub cannot be installed" (https://qiita.com/chanyoGUITAR/items/f0bf41918cbb458c4ac0).
that's all.
Recommended Posts