I decided I needed an audio alert for wandering mobs after I was brutally murdered by an roaming guard while happily medding in what I felt was a safe spot. The danger/caution filters only provide visual cues.
Now it works a bit like a reverse-sonar. Filtered mobs entering your FOV "ping" audibly, alerting you to their presence.
In one more revision I've added a command line parameter "%p", which will be replaced with a fractional value ranging from 0.100 - 1.500 (it's a fraction with 3 significant digits), which represents the proximity (0.1=at the very border of the FOV, 1.5=very very close - this value is reached before the mob is on top of the player). I use this as a volume modifier with sox, playing a Sonar sound and piping it through to esd:
Audio command:
Code:
/usr/local/bin/soxplayesd -v %p /usr/local/share/sounds/SonarShort.wav &
soxplayesd:
Code:
#!/bin/sh
/usr/bin/sox "$1" "$2" "$3" -c 4 -t .raw - 2>/dev/null | /usr/bin/esdcat 2>/dev/null
(you may have to change the -c parameter above depending on your soundcard/setup)
I've tested this patch for several hours yesterday and haven't encountered any problems with it (which doesn't mean there aren't any )
Cheers
-Tarwyn