Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

WolfSkunk ShoutForward

by strredwolf (Chaplain)
on Mar 23, 2001 at 04:28 UTC ( #66521=sourcecode: print w/replies, xml ) Need Help??
Category: Audio Related Programs
Author/Contact Info strredwolf
Description: Crude script which takes a MP3 from a site, downsamples, and reshouts it out to an Icecast server. It'll also work with a Shoutcast server, if you shout to the next port up.

Needs MPG123 and LAME. Contact me if you want to know more about Wolfox Radio.



# WolfSkunk ShoutForward
# v0.2 by Kelly "STrRedWolf" Price
# A downsampling restreamer!

### Configuration....
## Where to pull from...
## (Example:  Wolfox Radio)
# $source="";

## 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
$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";

               PeerAddr=> $destsite,
               PeerPort=> $destport)
    or die "$!";

print $out "$pass\r\n\r\n";
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;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://66521]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-10-19 21:36 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (111 votes). Check out past polls.