Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: MP3 server with IO::Socket

by Eradicatore (Monk)
on Feb 16, 2003 at 15:29 UTC ( [id://235731]=note: print w/replies, xml ) Need Help??


in reply to MP3 server with IO::Socket

Does anyone know what meta data to send to send the name of the song to players like XMMS or winamp? I see how to send the station name, but I don't see how to change that between songs... Thanks!

Update: Ahh, I see. I had to add code to send out icy-metaint in the header, and then puncture the stream with that meta data. There is a good description here:

here at http://www.smackfu.com/stuff/programming/shoutcast.html

and here at http://ample.sourceforge.net/developers.shtml

New Question Does anyone know how to downsample the MP3 that is being streamed here by the Perl Monkey code? Thanks!

Justin Eltoft

"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews

Replies are listed 'Best First'.
Re: Re: MP3 server with IO::Socket
by Anonymous Monk on Apr 16, 2003 at 03:00 UTC
    Further icy headers that winamp looks for, not sure about xmms. just replace your current headers with the below content.
    print $socket "ICY 200 OK\r\n"; print $socket "Content-Type: audio/mpeg \r\n"; print $socket "Cache-Control: no-cache \r\n"; print $socket "Pragma: no-cache \r\n"; print $socket "Connection: close \r\n"; print $socket "icy-name: Fuelradio \r\n"; print $socket "icy-genre: Techno \r\n"; print $socket "icy-url: http://www.fuelradio.com \r\n"; print $socket "icy-notice1:This stream requires Winamp \r\n"; print $socket "icy-notice2:Perl Streamer v0.1a \r\n"; print $socket "icy-metadata: 1 \r\n\r\n";
    additionaly you can add
    print $socket "icy-metaint:8192\r\n";
    althoug my tests with the metaint caused alot of skipping and chirps, maybe someone can shed some light on the proper interval, im sure its different than 8192 since the mp3's are not being decoded and re-encoded within the scope of the app, there just being shoved down the throat. Anyone have ideas on how to do title streaming (i.e. showing what song is playing in the winamp/xmms title bar) maybe a id3 lib for perl??
      Altho' I've not done any structured testing ( and i use XMMS ), I've notices some mp3's titles appear and some dont. I'm taking a guess here, but i think it could be ID3 tag related..
Re: Re: MP3 server with IO::Socket
by shirkdog_perl (Beadle) on Mar 04, 2003 at 06:57 UTC
    As well as that, I am interested in creating a buffer to allow more connections.

    I tested this script with 4 connections at a stream rate of 128kbp for the MP3's i have
    They said it would stall every couple of minutes
    I am gonig to be working on this tomorrow in case any monks have ideas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://235731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2024-04-18 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found