From owner-freebsd-questions@FreeBSD.ORG Thu Jun 17 23:29:36 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43C8A16A4CE for ; Thu, 17 Jun 2004 23:29:36 +0000 (GMT) Received: from gremlin.internode.com.au (gremlin.internode.com.au [192.83.231.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EB3343D2F for ; Thu, 17 Jun 2004 23:29:35 +0000 (GMT) (envelope-from adam@internode.com.au) Received: from gremlin.internode.com.au (localhost [127.0.0.1]) i5HNSlfv000992; Fri, 18 Jun 2004 08:58:47 +0930 (CST) (envelope-from adam@internode.com.au) Received: (from adam@localhost)i5HNSju7000989; Fri, 18 Jun 2004 08:58:45 +0930 (CST) (envelope-from adam@internode.com.au) X-Authentication-Warning: gremlin.internode.com.au: adam set sender to adam@internode.com.au using -f Date: Fri, 18 Jun 2004 08:58:45 +0930 From: Adam Smith To: klr@6s-gaming.com Message-ID: <20040617232845.GC694@internode.com.au> References: <3502.81.84.175.12.1087503323.squirrel@81.84.175.12> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3502.81.84.175.12.1087503323.squirrel@81.84.175.12> User-Agent: Mutt/1.4.2.1i X-Face: $vsV$1FNbZN\JVpjV#&+/!oVW`Kw$j?w_,te\SS}(tKD21c+l$t%\RCS(r$G; XXk]6,(!N:&(N3EV0bY`3):UrgG7'*qsj3l.75IaHV1<`i*{[L\:F*l6fH##C:-p2]xW/R-Z:!bo; 5g3GP-{I{}7O>tN}`Xm/=-:8NG?f-r'$Qc3y[aW-7'W_S<`KYU!_; `7K=kuC$-.7J2*kk=~`c@ADp+xhsv(!a@eW-R_5wtx+tC)(]%W+ cc: freebsd-questions@freebsd.org Subject: Re: need help on shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2004 23:29:36 -0000 On Thu, Jun 17, 2004 at 08:15:23PM -0000, klr@6s-gaming.com said: > Hi list, > > I read http://www.linuxgazette.com/node/view/9074 and tried to adopt this > script to my ipfw firewall: > > #!/bin/sh > tail -f /var/log/security | \ > awk ' > $0 ~ /ICMP/ { > system("cat /root/sounds/icmp.wav > /dev/dsp "); > } > $0 ~ /TCP/ { > system("cat /root/sounds/tcp.wav > /dev/dsp "); > } > $0 ~ /UDP/ { > system("cat /root/sounds/udp.wav > /dev/dsp "); > } > ' > > This is what I got. However, sounds won't play one after another. e.g, if > 3 packets are blocked at the same time, 2 TCP and one UDP, the system will > always wait for a sound to finish before playing the next. I want it to be > able to play the sounds in sequence (as fast as possible), but I couldn't > figure a way out! This is the behaviour of the device, not your script. Only one process can access the device at any one time, and so your subsequent sounds must wait for the first one to finish before it will be able to use /dev/dsp. When using /dev/dsp, programs like artsd (which comes with KDE) allow other artsd-aware programs to send sound events through the artsd daemon, and artsd controls all the mixing of sounds together to send them out through /dev/dsp. So, you need something like this to play your events, rather than catting them to /dev/dsp. Unfortunately I don't know of any console programs that do this. Try looking in /usr/ports/audio :) -- Adam Smith Internode : http://www.internode.on.net Phone : (08) 8228 2999 Dog for sale: Eats lots and is fond of children.