Skip to Content.
Sympa Menu

baslinux - Re: [BL] MPlayer

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] MPlayer
  • Date: Sat, 7 May 2005 19:07:24 +0000 (UTC)

On Sat, 7 May 2005, David Moberg wrote:

----- Original Message -----
From: "sindi keesan" <keesan AT sdf.lonestar.org>

Try:

mkfifo audiodump.wav
mplayer -ao pcm http://(URL of streaming mp3) & play audiodump.wav & fg; fg


I tried various combinations (using the latest compiled mplayer,
which now installs properly) and if I mkfifo audiodump.wav, mplayer
does not seem to write anything to audiodump.wav (I have a 0 file)
though it says something about filling a cache.

An explanation of FIFOs is in order. Basically, a FIFO is a file
which behaves like a pipe. If you tell something like MPlayer to
write to a file, it will write to it, _and stop_ when the FIFO
is full. Nothing will happen until you tell something to read
from the FIFO (e.g. play from sox). So you need to:

1) Make a FIFO (mkfifo)
2) Tell MPlayer to start sending data to the FIFO
3) Tell play to play the FIFO
4) If any of the above programs have gone into the background,
you must awaken them with fg (at least, I have to with bash)

It may be best to do everything manually:

1) In VT1, mkfifo audiodump.wav
2) Still in VT1, mplayer -ao pcm http://(URL of streaming mp3)
3) Switch to VT2 and play audiodump.wav

You can automate this once you verify that it works.

This is what I am doing, except I had to leave out the mkfifo line because otherwise nothing writes to the .wav file, it stays at 0 size.

I do not have an 'fg' on this computer either.


If I just type in the part before the & and then play audiodump.wav
(which I did now) it plays just fine but my file keeps getting
larger. I will try this on realaudio some time. We are going to
work on the 600 and 750MHz models now instead.

The FIFO is what is supposed to keep the size in check. Once a byte
is read from a FIFO, whatever is writing into a FIFO is allowed to
send another byte in. The original byte is lost, so the FIFO does
not grow.

The FIFO .wav file did not get larger than 0 bytes. Do I need to set it up differently, specifying the maximum size somehow?

I started the play only about 30 sec after I started mplayer, and
it is still playing a few minutes later, so as long as I have lots
of free hard drive space I will be okay, but wav files are large.
I am already at 18MB in 5 minutes. 60 minutes would be 200MB. I
suppose I could delete and restart at the end of each piece.

Or have a kludgey shell script do this for you by waiting a set period,
deleting the file, and restarting everything. I would prefer the FIFO
method, as this method will result in gaps in the audio.

I can time the gaps to be during the parts where they talk.

I see at the end of the screen:

Starting playback...
mpg123: Can't rewind stream by 62 bits!
A: 5:40.2 (the time?) 93.5% 0%


But ps says I am using sox, not mpg123.

Perhaps MPlayer uses mpg123 if it exists?
Maybe, but it appeared to be using sox/play.

I will try this on a realaudio file next (same URL harvesting
technique as for mp3 files).
It worked, also on a WMP file.

David
--

Are you also sitting inside all afternoon on the nicest day in May?




Archive powered by MHonArc 2.6.24.

Top of Page