Discussion:
[mad-user] Playing Internet Streams with Madplay
Mark Kane
2006-10-08 18:30:56 UTC
Permalink
Hi everyone.

This may be a stupid question, but I've read through the madplay man
page and online documentation several times and I cannot get an MP3
Internet radio station (SHOUTcast) to play with madplay.

Every time I try on the command line, I get:

------------------------------------------------------
[***@amd64:~]% madplay http://stream.com:8000
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al.
http://stream.com:8000: No such file or directory
------------------------------------------------------

I've tried with and without the trailing slash on the URL, with/without
quotes on the URL, and adding the "listen.pls" at the end. Still the
same. Tried downloading the .pls and playing it from the file, although
that gives this:

------------------------------------------------------
[***@amd64:~]% madplay listen.pls
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al. error: frame 0: lost synchronization
0 frames decoded (0:00:00.0), -inf dB peak amplitude, 0 clipped samples
[***@amd64:~]%
------------------------------------------------------

What am I doing wrong? Thanks in advance.

-Mark
madplay-0.15.2b
--
Internet Radio:
Party107 (Trance/Electronic) - http://www.party107.com
Rock 101.9 The Edge (Rock) - http://www.rock1019.net

IRC:
MIXXnet IRC Network - irc.mixxnet.net (Nick: MIXX941)
Rob Leslie
2006-10-12 18:55:42 UTC
Permalink
Post by Mark Kane
This may be a stupid question, but I've read through the madplay
man page and online documentation several times and I cannot get an
MP3 Internet radio station (SHOUTcast) to play with madplay.
------------------------------------------------------
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al.
http://stream.com:8000: No such file or directory
------------------------------------------------------
There's no network streaming support in madplay; to play a stream
this way, you could instead:

% wget -O - http://stream.com:8000 | madplay -
Post by Mark Kane
I've tried with and without the trailing slash on the URL, with/
without quotes on the URL, and adding the "listen.pls" at the end.
Still the same. Tried downloading the .pls and playing it from the
------------------------------------------------------
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al.
error: frame 0: lost synchronization
0 frames decoded (0:00:00.0), -inf dB peak amplitude, 0 clipped samples
------------------------------------------------------
There is no playlist support in madplay either, sorry.
--
Rob Leslie
***@mars.org
Mark Kane
2006-10-12 19:11:34 UTC
Permalink
Post by Rob Leslie
Post by Mark Kane
This may be a stupid question, but I've read through the madplay
man page and online documentation several times and I cannot get
an MP3 Internet radio station (SHOUTcast) to play with madplay.
------------------------------------------------------
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al.
http://stream.com:8000: No such file or directory
------------------------------------------------------
There's no network streaming support in madplay; to play a stream
% wget -O - http://stream.com:8000 | madplay -
Thanks. That is what I thought, but someone on an Asterisk mailing list
kept insisting there is a way to play streams with madplay directly so I
thought I was missing something. I tried piping it into madplay
using cURL which worked great on the command line, but pipes wouldn't
work in Asterisk's music on hold.

Thanks again.

-Mark
--
Internet Radio:
Party107 (Trance/Electronic) - http://www.party107.com
Rock 101.9 The Edge (Rock) - http://www.rock1019.net

IRC:
MIXXnet IRC Network - irc.mixxnet.net (Nick: MIXX941)
john cooper
2006-10-12 21:00:29 UTC
Permalink
Post by Mark Kane
Post by Rob Leslie
Post by Mark Kane
This may be a stupid question, but I've read through the madplay
man page and online documentation several times and I cannot get
an MP3 Internet radio station (SHOUTcast) to play with madplay.
------------------------------------------------------
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert
Leslie et al.
http://stream.com:8000: No such file or directory
------------------------------------------------------
There's no network streaming support in madplay; to play a stream
% wget -O - http://stream.com:8000 | madplay -
Thanks. That is what I thought, but someone on an Asterisk mailing list
kept insisting there is a way to play streams with madplay directly so I
thought I was missing something. I tried piping it into madplay
using cURL which worked great on the command line, but pipes wouldn't
work in Asterisk's music on hold.
I'd written a decode engine wrapped around libmad which treats
the input as a byte stream. Basically libmad wants to consume
a virtually endless linear buffer of encoded data. However
you can redirect the location of decode such that a fixed
size buffer can emulate an endless data stream.

mad_frame_decode() returns after consuming a frame which provides
the opportunity to perform seamless relocation of the buffer data.
This requires moving the remaining frame aligned buffer data to
the buffer head and pointing the libmad decode at its new
location. Along with doing so would be filling the buffer
with additional stream data as presumably the reason for the
relocation was running close to the fixed buffer end.

This isn't too complicated. But it gets more so when implementing
trick/skip play in an arbitrary direction. Ie: a stream browsing
operation which continually skips a few seconds fwd/back without
pcm output and then generates a few pcm frames as output.

-john
--
***@third-harmonic.com
Loading...