Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
MP3 Server in Perl ...hmmm interesting but you know what is more interesting ...
Here is the Bash version ;)
#!/bin/bash DIR=`pwd` echo "BASH_MP3D - A Streaming MP3 Server in Bash " echo "And You are as crazy as me if you are running this .... " echo echo "Generating Playlist .....Plz wait" PLAYLIST=`find $DIR -name *.mp3` NUM=`echo $PLAYLIST | wc -w` echo "done." echo "Listening on 5700 ....." { while true do #get seconds for random number rand=`date | cut -d ':' -f 3 |cut -d ' ' -f1` let "rand += 1" while [ "$rand" -gt "$NUM" ] do let "rand -= $NUM" done SONG=`echo $PLAYLIST | cut -d ' ' -f$rand` #Now we play the random song SONG echo "Playing $SONG ... " >& 2 echo "HTTP/1.0 200 OK"; echo "Content-Type: audio/x-mp3stream"; echo "Cache-Control: no-cache "; echo "Pragma: no-cache "; echo "Connection: close "; echo "x-audiocast-name: BASH MP3 Server"; echo; echo; dd if=$SONG bs=1024 done }| nc -l -p 5700

In reply to Re: Re: MP3 server with IO::Socket by Anonymous Monk
in thread MP3 server with IO::Socket by perlmonkey

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (4)
    As of 2020-05-27 08:39 GMT
    Find Nodes?
      Voting Booth?
      If programming languages were movie genres, Perl would be:

      Results (153 votes). Check out past polls.