[MPlayer-users] How to create a wav file with silence with MPlayer

Giacomo Comes comes at naic.edu
Mon Oct 3 23:54:51 CEST 2005


On Mon, Oct 03, 2005 at 05:32:02PM -0400, Rich Felker wrote:
> On Mon, Oct 03, 2005 at 10:54:53AM -0400, Giacomo Comes wrote:
> > Hi,
> > Up to MPlayer 1.0pre7 I was able to create a wav file with silence with the
> > following command line:
> > 
> > mplayer -rawaudio on:format=0x1:rate=48000 /dev/zero -nocache -frames 4 -ao pcm:waveheader:file=silence.wav
> > 
> > The advantage of this method is that I can easily select the frame rate and
> > the duration (-frames) of the wav file.
> > 
> > With CVS the syntax has changed. The corresponding command line is:
> > 
> > mplayer -demuxer 20 -rawaudio format=0x1:rate=48000 /dev/zero -nocache -frames 4 -ao pcm:waveheader:file=silence.wav
> > 
> > The problem now is that MPlayer never stops. It ignores completly the option -frames. Is there a way to restore the old beahviour?
> 
> What in the world do you mean by 4 frames of pcm audio??

That's a feature of mplayer! 
With the previous command line I would create a silent wav file
with duration of n+1 * k seconds where n is the argument of -frames 
and k=341.3ms
May be it is meanless to use -frames with pure audio, but it
worked like that.

> Anyway using mplayer for this is rather overkill. It can be done
> trivially with a shell script, almost as short as your mplayer command
> line...

I'm sure there are plent of possibilities, mplayer is not
the only tool that can do it, I'm just saying that it does
not work anymore in CVS and it worked before.

Giacomo




More information about the MPlayer-users mailing list