#!/usr/bin/perl $|=1; # WolfSkunk ShoutForward # v0.2 by Kelly "STrRedWolf" Price # A downsampling restreamer! ### Configuration.... ## Where to pull from... ## (Example: Wolfox Radio) # $source="http://166.90.143.148:9160/"; $source="http://localhost:8000/166.90.143.148:9160/"; ## Where to shout it to. # Shouting to Icecast goes to the same server, # but to a Shoutcast server, you need to shout it to server port+1 # Example local icecast server $destsite='localhost'; $destport=8000; $pass='put up one yourself'; ## Lame Options. # Default: 16kbps Mono (from sterio) $lameopt='-b 16 -m m -a'; ### Code use IO::Socket; print "WSS> Shouting from $source\nto $destsite:$destport...\n"; $out=IO::Socket::INET->new(Proto=>'tcp', PeerAddr=> $destsite, PeerPort=> $destport) or die "$!"; $out->autoflush(1); print $out "$pass\r\n\r\n"; $code=<$out>; print $code; die "Got from server $code" if($code !~ /^OK/); print "WSS> We're in!\n"; # while(<$out>) # { # print "WSS> $_"; # tr/\r\n//d; # last if(/^$/); # } print $out "icy-name: [[[WolfFox Radio]]] Charm's Mix Party! Herm Have +n Mix-Dance-Techno/Goa\r\n"; print $out "icy-url: http://localhost:8000/\r\n"; print $out "icy-pub: 0\r\n"; print $out "icy-genre: Test\r\n"; print $out "icy-br: 20\r\n"; print $out "\r\n\r\n"; open(IN,"mpg123 -b 2048 -s $source | lame $lameopt -x -s 22.05 - - |") +; while(1) { $_=<IN>; print $out $_; } close $out; close IN;

In reply to WolfSkunk ShoutForward by strredwolf

Title:
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, details, 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, summary, 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.