#!/usr/bin/perl
#play
use CGI;
use CGI::Carp (fatalsToBrowser);
$q=new CGI;
$ip=$ENV{'REMOTE_ADDR'};
chomp $ip;


$pref="(Plummet)(Honkytonk Im Nachtlokal) - "; 
$no=$q->param(nr);
$file=$pref.$no.".ogg";

open (MUS, $file) || die "Cannot open file $file\n" 
		       ;
$size=-s MUS;
print "Content-type: audio/x-vorbis;\nContent-disposition: inline; filename= $file \nContent-Length: $size\n\n";
open (LOG, ">>log/access.log");
$tijd=qx(date);
chomp($tijd);
print LOG ("$tijd",":::".$ip.":::","$file\n");
close LOG;
while (<MUS>)
{ print $_}
#print "Content-type: text/plain\n\n";
#print $size;print "\n\n";
close MUS; 
exit;

