ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/sound.pl
Revision: 1.1
Committed: Sat May 31 09:46:51 2003 UTC (21 years ago) by pcg
Content type: text/plain
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# Content
1 package sound;
2
3 #my $audioserver = new Audio::Play(0);
4 my %sound;
5 $SIG{CHLD} = 'IGNORE';
6
7 for (qw(alarm warning move pass ring connect user_unknown)) {
8 local $/;
9 open my $snd, "<", "$::SNDDIR/$_"
10 or die "$::SNDDIR/$_: $!";
11 binmode $snd;
12
13 $sound{$_} = new Audio::Data;
14 $sound{$_}->Load($snd);
15 }
16
17 sub play {
18 my ($annoyancy, $sound) = @_;
19 # annoyany 1 => important, annoyance 2 => useful, annoyancy 3 => not useful
20 if (fork == 0) {
21 if (my $audioserver = new Audio::Play(1)) {
22 $audioserver->play ($sound{$sound});
23 }
24 use POSIX ();
25 POSIX::_exit(0);
26 }
27 }
28
29 1;