#!/usr/bin/perl
use MP3::Info;

while (<STDIN>) {
	#print $_;
	$file = $_;
	chomp($file);
	my $mp3 = new MP3::Info "$file" ;

	if ( eval { my $mp3 = new MP3::Info $file; } )
	{
		$artist = $mp3->artist || "Unknown";
		$title = $mp3->title;
		$secs = int(($mp3->secs)+0.5);
		$information = "$secs, $artist - $title";
	}
	else
	{
		#print STDERR "Error Evaluating $file: $@\n";
		$information = "$file";
	}

	printf "#EXTINF:$information\n";
	printf "$file\n";
  
}


