I want to add silence to the beginning of a wav file for 1 second

Thing you want to do

"I want to add silence for 1 second to the beginning of a file called b.wav !!"

Implementation

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')

Install pydub

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

I want to add silence to the beginning of a wav file for 1 second
I want to extract the tag information (title and artist) of a music file (flac, wav).
I want to create a Dockerfile for the time being.
I want to output the beginning of the next month with Python
I want to sort a list in the order of other lists
How to put a line number at the beginning of a CSV file
I made a program to check the size of a file in Python
Python: I want to measure the processing time of a function neatly
I want to customize the appearance of zabbix
I want to write to a file with Python
[For beginners] I want to get the index of an element that satisfies a certain conditional expression
I want to display only different lines of a text file with diff
The story of IPv6 address that I want to keep at a minimum
I want to make a music player and file music at the same time
Save an array of numpy to a wav file using the wave module
I want to set a life cycle in the task definition of ECS
I want to see a list of WebDAV files in the Requests module
I want to see the file name from DataLoader
I want to grep the execution result of strace
I want to randomly sample a file in Python
I want to fully understand the basics of Bokeh
I want to install a package of Php Redis
I want to increase the security of ssh connections
The story of Linux that I want to teach myself half a year ago
I want to take a screenshot of the site on Docker using any font
I want to create a lunch database [EP1] Django study for the first time
I want to create a lunch database [EP1-4] Django study for the first time
[TensorFlow] I want to master the indexing for Ragged Tensor
I want to move selenium for the time being [for mac]
I want to start a lot of processes from python
I want to use only the normalization process of SudachiPy
NikuGan ~ I want to see a lot of delicious meat! !!
I want to get the operation information of yahoo route
I made a function to check the model of DCGAN
I want to judge the authenticity of the elements of numpy array
I want to know the features of Python and pip
Keras I want to get the output of any layer !!
I want to know the legend of the IT technology world
[Python] I want to make a 3D scatter plot of the epicenter with Cartopy + Matplotlib!
[For beginners] I want to explain the number of learning times in an easy-to-understand manner.
I want to find the intersection of a Bezier curve and a straight line (Bezier Clipping method)
I want to output a beautifully customized heat map of the correlation matrix. matplotlib edition
I want to get the name of the function / method being executed
I want to record the execution time and keep a log.
I want to manually assign the training parameters of the [Pytorch] model
Conditional branch due to the existence of a shell script file
I want to read the html version of "OpenCV-Python Tutorials" OpenCV 3.1 version
[Introduction to StyleGAN] I played with "The Life of a Man" ♬
I want to create a system to prevent forgetting to tighten the key 1
How to output the output result of the Linux man command to a file
I want to make the second line the column name in pandas
For the time being, I want to convert files with ffmpeg !!
I want to check the position of my face with OpenCV!
I want to know the population of each country in the world.
[Twitter] I want to make the downloaded past tweets (of my account) into a beautiful CSV
I want to clear up the question of the "__init__" method and the "self" argument of a Python class.
I want to specify a file that is not a character string for logrotate, but is it impossible?
I want to pin Spyder to the taskbar
(For myself) Flask_5 (Add to txt file)
I want to output to the console coolly
[Note] I want to completely preprocess the data of the Titanic issue-Age version-