This is a quick and dirty hack tested on linux and solaris to poll an X server via the XKEYBOARD extension for XBell() events (i.e. "beeps") and then play an audio file "ding" on the sound device. I use this on slow hardware (Xterminal) without a "PC speaker" functionality to give audible feedback for the bell while in X. Since the hardware is slow and to minimize lags the audio device is opened and written to directly. There is an option '-sox' to run an external command (sox or audioplay) and on a faster machine that is fine. The writing the program does to the audio device is a complete hack/lash-up and is likely very nonportable.