<?

include("config.inc.php");

$stream_quality=96; // Kbit/s
$buffer_time=3; // In Minutes

$stream_quality=96; // Kbit/s
$buffer_time=3; // In Minutes

$stream_quality_kbytes=$stream_quality/8;
$stream_quality_kbytes_per_minute=$stream_quality*60;
// $stream_quality_kbytes_per_minute=$stream_quality_bytes_per_minute/1024;

$content_length=$buffer_time*1024*$stream_quality_kbytes_per_minute;

$length_header="Content-length: ".$content_length;

// mail("sven.wagener@rheinschmiede.de","123",$length_header);

header("Content-type: audio/mpeg"); 
header($length_header); 
$sock = fsockopen($host,$port); 

fputs($sock, "GET $path HTTP/1.0\r\n"); 
fputs($sock, "Host: $host\r\n"); 
fputs($sock, "User-Agent: WinampMPEG/2.8\r\n"); 
fputs($sock, "Accept: */*\r\n"); 
fputs($sock, "Icy-MetaData:0\r\n"); 
fputs($sock, "Connection: close\r\n\r\n"); 

fpassthru($sock); 
fclose($sock);

?>