#!/usr/bin/perl -T -w
use strict;
$ENV{PATH}='';
&main();
exit 0;

sub play
{
  my ($file)=@_;
	print "$file\n";
  my $cmd = "/usr/bin/gst-launch-0.10 filesrc location=${file}.ogg ! oggdemux ! vorbisdec ! audioconvert ! autoaudiosink";
	print "$cmd\n";
  print `$cmd`;
}

sub main
{
  while (my $schuss = <STDIN>)
  {
		print $schuss;
    chomp $schuss;
		
    my ($mult,$zahl)=split /\s+/,$schuss;
		if ($mult==2)
		{
		  play("double")
		} elsif ($mult==3) {
		  play("triple")
    }
		($zahl) = $zahl =~ m/(\d+)/;
		if ($zahl >0 && $zahl < 21)
    {
			play($zahl)
		} else {
			play("bull")
		}
  } 
}

