From: Jan "Yenya" Kasprzak Date: Sat, 7 Dec 2013 10:45:49 +0000 (+0100) Subject: Sound: joined sound files X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=slotcarman.git;a=commitdiff_plain Sound: joined sound files Aplay makes too long pause between the sound files, so I have decided to precompute joined files using sox(1). --- diff --git a/SCX/Sound.pm b/SCX/Sound.pm index 9a7180a..5d50bfb 100644 --- a/SCX/Sound.pm +++ b/SCX/Sound.pm @@ -22,8 +22,7 @@ sub _play { return if $self->{muted}; - @names = map { $self->{data_dir} . '/' . $_ . '.wav' } @names; - system (join(' ', 'aplay', @names). ' &'); + system 'aplay', $self->{data_dir} . '/' . join('-', @names) . '.wav'; } sub mute { shift->{muted} = 1; } @@ -35,13 +34,13 @@ sub filled { shift->_play('filled'); } sub winner { my ($self, $car_id) = @_; - $self->_play('winner', $car_id, 'winner'); + $self->_play('winner', $car_id); } sub box { my ($self, $car_id) = @_; - $self->_play('box', $car_id, 'box'); + $self->_play('box', $car_id); } sub best_lap { diff --git a/sounds/bestlap-0.wav b/sounds/bestlap-0.wav new file mode 100644 index 0000000..8ce205f Binary files /dev/null and b/sounds/bestlap-0.wav differ diff --git a/sounds/bestlap-1.wav b/sounds/bestlap-1.wav new file mode 100644 index 0000000..cbffa6a Binary files /dev/null and b/sounds/bestlap-1.wav differ diff --git a/sounds/bestlap-2.wav b/sounds/bestlap-2.wav new file mode 100644 index 0000000..b772a08 Binary files /dev/null and b/sounds/bestlap-2.wav differ diff --git a/sounds/bestlap-3.wav b/sounds/bestlap-3.wav new file mode 100644 index 0000000..8a58790 Binary files /dev/null and b/sounds/bestlap-3.wav differ diff --git a/sounds/bestlap-4.wav b/sounds/bestlap-4.wav new file mode 100644 index 0000000..bc18146 Binary files /dev/null and b/sounds/bestlap-4.wav differ diff --git a/sounds/bestlap-5.wav b/sounds/bestlap-5.wav new file mode 100644 index 0000000..fb82ed8 Binary files /dev/null and b/sounds/bestlap-5.wav differ diff --git a/sounds/box-0.wav b/sounds/box-0.wav new file mode 100644 index 0000000..74d8e98 Binary files /dev/null and b/sounds/box-0.wav differ diff --git a/sounds/box-1.wav b/sounds/box-1.wav new file mode 100644 index 0000000..1e57524 Binary files /dev/null and b/sounds/box-1.wav differ diff --git a/sounds/box-2.wav b/sounds/box-2.wav new file mode 100644 index 0000000..f01469a Binary files /dev/null and b/sounds/box-2.wav differ diff --git a/sounds/box-3.wav b/sounds/box-3.wav new file mode 100644 index 0000000..21877b1 Binary files /dev/null and b/sounds/box-3.wav differ diff --git a/sounds/box-4.wav b/sounds/box-4.wav new file mode 100644 index 0000000..f5c7f5e Binary files /dev/null and b/sounds/box-4.wav differ diff --git a/sounds/box-5.wav b/sounds/box-5.wav new file mode 100644 index 0000000..7edb313 Binary files /dev/null and b/sounds/box-5.wav differ diff --git a/sounds/combine.sh b/sounds/combine.sh new file mode 100755 index 0000000..cff8f4f --- /dev/null +++ b/sounds/combine.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +for n in `seq 0 5` +do + sox {box,$n,box}.wav box-$n.wav +done + +for n in `seq 0 5` +do + sox {bestlap,$n}.wav bestlap-$n.wav +done + +for n in `seq 0 5` +do + sox {winner,$n,winner}.wav winner-$n.wav +done + + diff --git a/sounds/winner-0.wav b/sounds/winner-0.wav new file mode 100644 index 0000000..7682206 Binary files /dev/null and b/sounds/winner-0.wav differ diff --git a/sounds/winner-1.wav b/sounds/winner-1.wav new file mode 100644 index 0000000..c35f682 Binary files /dev/null and b/sounds/winner-1.wav differ diff --git a/sounds/winner-2.wav b/sounds/winner-2.wav new file mode 100644 index 0000000..8a35f7e Binary files /dev/null and b/sounds/winner-2.wav differ diff --git a/sounds/winner-3.wav b/sounds/winner-3.wav new file mode 100644 index 0000000..4679af6 Binary files /dev/null and b/sounds/winner-3.wav differ diff --git a/sounds/winner-4.wav b/sounds/winner-4.wav new file mode 100644 index 0000000..b7d7132 Binary files /dev/null and b/sounds/winner-4.wav differ diff --git a/sounds/winner-5.wav b/sounds/winner-5.wav new file mode 100644 index 0000000..ea81fc2 Binary files /dev/null and b/sounds/winner-5.wav differ