Create a silent mp3 from the command line

Stephen picture Stephen · Mar 11, 2011 · Viewed 15.6k times · Source

I am trying to create a silent / empty mp3 file of (x) seconds using the command line. Quite a simple task I thought!

It seems LAME is able to do something like this, but I am unable to find anything that leads to achieving this.

Has anyone been able to do something like this?

Answer

nico_lab picture nico_lab · May 23, 2013

You can use this command.

ffmpeg -f lavfi -i anullsrc=r=44100:cl=mono -t <seconds> -q:a 9 -acodec libmp3lame out.mp3

Change <seconds> to a number indicating the number of seconds of silence you require (for example, 60 will create a minute).