Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a silent mp3 from the command line

Tags:

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?

like image 608
Stephen Avatar asked Mar 11 '11 17:03

Stephen


People also ask

How do I play MP3 files from terminal?

Just go to the folder containing the MP3 files that you want to play and type mpg123 *. mp3. You can also load a playlist file and use the *-z* option on the command line to shuffle the tracks you want to play. If you're adamant about using truly open formats, then you'll want to go with Ogg Vorbis for your music.


1 Answers

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

like image 120
nico_lab Avatar answered Oct 07 '22 01:10

nico_lab