MP3 Streaming on Demand? 14
Joe asks: "I've checked freshmeat a number of times, but I can't seem to find
any software that will stream mp3 files 'on demand'. Most software
for mp3 streaming (be it windows or unix) is based on the broadcast
model (shoutcast/icecast), where a fixed or growing playlist keeps
playing at all times. What I want is something that works on the 'play samples' model, where a sample of the tune is played automatically through a streaming protocol, rather than downloaded
and played once downloaded. Any such beast exist? If not, why not?"
"I suppose with enough fidgetting, one could write a cgi program (even as a /bin/sh script) that would start a new icecast process on a particular port, start the shout stream, and return to the browser the "playlist" that would signal the browser to start winamp/xmms on the appropriate port; the "start the shout stream" process would wait play silence for a few seconds before shouting the desired mp3 in order to give time to the player...but that seems rather kluge-like."
cgi is the key (Score:3)
icecast can do it, but... (Score:1)
Mp3 Streaming - history, hints (Score:2)
Anyway, if you enter a URL in the Play Location: window of Winamp (ctrl-click on the eject button, or Ctrl-L), it will stream an MP3 at that location.
The bitch is that most web browsers will preempt streaming, waiting for the file to be fully downloaded before it passes it onto any helper app. This is in theory safer, but ya oughtta be able to turn off the deferral.
The answer of streaming from web links is to use M3U playlists for the file(s) you want to stream. The playlist contains the URL of the streamworthy file, and the web browser is none the wiser -- it passes the very small M3U onto the player, which then takes over the downloading of the file listed inside, streaming it in the meantime.
I suppose therefore you might want a script on your server that will generate M3U output on the fly for your online music collection. Such a script would be very simple -- in theory it only needs to output text data consisting of a URL to the actual file.
However, I usually just use "Copy Link Location" or "Copy Shortcut" from the right-click-over-link menu, and then paste it into the Winamp "Play Location" window. And there you have it, instant streaming on demand.
--
This has been under our noses forever. (Score:1)
bagh (Score:3)
If we wanted to listen to something on our computer, we plopped a music CD in the CDROM tray. If we wanted to listen to something in a different part of our house, we didn't stream it to the computer in that room, we turned the volume up in the other room.
Nowadays, all you kids with your stream this, or rip that attitudes are causing those hard working record industry executives to get there panties in a bundle. The recording industry barely gets by on its razor thin profit margins, and any of this digital streaming might cause them to to go bust! If you weren't such lazy hooligans, you'd carry around your store bought CD around with you and listen to that.
Here's one we use (Score:2)
http://www.lyra.org/greg/edna
It's a standalone http mp3 server. In one
python script. It sends
so that the mp3s are streamed. It can also
shuffle and play recursively.
Highly recommended.
Stephen.
(for the other end of things 'jack' is an
excellent ripper/encoder btw.)
http is fine (Score:2)
HTTP Streaming (Score:1)
The two virtualhosts were on the same machine, and could be setup on one if needed - I split them for easy of use, maintenance, and security (I set it up while at school, so I wanted the thing restricted so I didn't become the biggest bandwidth user on campus).
As for speed and such. When I click on a link the song is usually started before my finger is lifted off the mouse button (both at home on 100Mbps LAN and at school on the 10Mbps LAN). The response time is basically a factor of how fast the server is, how fast your browser can get the address to the player, and how fast the player can parse and request the address.
Check MP3.com (Score:1)
Look at a typical MP3.com URL:
http://chooser.mp3.com/cgi-bin/play/play.cgi/[s
Probably a simple CGI which stores the session data (things like IP, browser, OS etc.) and serves you the MP3 trough the playlist.
bBob
--
cgi streaming (Score:2)
Apache::MP3 (Score:1)
thanks for the help... (Score:2)
In addition, I got the apache system to work well enough for my needs (though i need to fitz with LAME to get smaller files -- 44/128s would kill my bitrate quota). the trick was to add the "audio/x-mpegurl m3u" line to the server mime.types file (it isn't there by default).
If you are using someone else's server (you can't change conf info), you can also do it by puting the line "AddType audio/x-mpegurl .m3u" in the .htaccess file for the directory containing the m3us. to minimize constant .htaccess accessing (apache will look it up for every load in that path), you might consider putting all the .m3u files in a single directory by themselves.
Thanks for the pointers...
Re:Mp3 Streaming - history, hints (Score:1)
--
Re:cgi streaming (Score:1)