8 my ($class, $args) = @_;
11 data_dir => $args->{data_dir} || './sounds/',
21 my ($self, @names) = @_;
23 return if $self->{muted};
25 @names = map { $self->{data_dir} . '/' . $_ . '.wav' } @names;
26 system (join(' ', 'aplay', @names). ' &');
29 sub mute { shift->{muted} = 1; }
30 sub unmute { shift->{muted} = 0; }
32 sub start { shift->_play('start'); }
33 sub filled { shift->_play('filled'); }
36 my ($self, $car_id) = @_;
38 $self->_play('winner', $car_id, 'winner');
42 my ($self, $car_id) = @_;
44 $self->_play('box', $car_id, 'box');
48 my ($self, $car_id) = @_;
50 $self->_play('bestlap', $car_id);