]> www.fi.muni.cz Git - slotcarman.git/commitdiff
Sound: joined sound files master
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 7 Dec 2013 10:45:49 +0000 (11:45 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 7 Dec 2013 10:45:49 +0000 (11:45 +0100)
Aplay makes too long pause between the sound files, so I have decided
to precompute joined files using sox(1).

20 files changed:
SCX/Sound.pm
sounds/bestlap-0.wav [new file with mode: 0644]
sounds/bestlap-1.wav [new file with mode: 0644]
sounds/bestlap-2.wav [new file with mode: 0644]
sounds/bestlap-3.wav [new file with mode: 0644]
sounds/bestlap-4.wav [new file with mode: 0644]
sounds/bestlap-5.wav [new file with mode: 0644]
sounds/box-0.wav [new file with mode: 0644]
sounds/box-1.wav [new file with mode: 0644]
sounds/box-2.wav [new file with mode: 0644]
sounds/box-3.wav [new file with mode: 0644]
sounds/box-4.wav [new file with mode: 0644]
sounds/box-5.wav [new file with mode: 0644]
sounds/combine.sh [new file with mode: 0755]
sounds/winner-0.wav [new file with mode: 0644]
sounds/winner-1.wav [new file with mode: 0644]
sounds/winner-2.wav [new file with mode: 0644]
sounds/winner-3.wav [new file with mode: 0644]
sounds/winner-4.wav [new file with mode: 0644]
sounds/winner-5.wav [new file with mode: 0644]

index 9a7180abb4a107489e1d1855fc95177eb5a0e0b0..5d50bfb78a3e50336aa2ab1a77a9dda35b30a2a9 100644 (file)
@@ -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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (executable)
index 0000000..cff8f4f
--- /dev/null
@@ -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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
index 0000000..ea81fc2
Binary files /dev/null and b/sounds/winner-5.wav differ