1 | package sound; |
1 | package sound; |
|
|
2 | |
|
|
3 | use KGS::Constants; |
2 | |
4 | |
3 | #my $audioserver = new Audio::Play(0); |
5 | #my $audioserver = new Audio::Play(0); |
4 | my %sound; |
6 | my %sound; |
5 | $SIG{CHLD} = 'IGNORE'; |
7 | $SIG{CHLD} = 'IGNORE'; |
6 | |
8 | |
|
|
9 | for (map +(KGS::Constants::findfile "KGS/kgsueme/sounds/$_"), |
7 | for (qw(alarm warning move pass ring connect user_unknown gamestart resign)) { |
10 | qw(alarm warning move pass ring connect user_unknown gamestart resign)) { |
8 | local $/; |
11 | local $/; |
9 | open my $snd, "<", "$::SNDDIR/$_" |
12 | open my $snd, "<", $_ |
10 | or die "$::SNDDIR/$_: $!"; |
13 | or die "$_: $!"; |
11 | binmode $snd; |
14 | binmode $snd; |
12 | |
15 | |
13 | $sound{$_} = new Audio::Data; |
16 | $sound{$_} = new Audio::Data; |
14 | $sound{$_}->Load($snd); |
17 | $sound{$_}->Load($snd); |
15 | } |
18 | } |