There is a Javascript version in openacs3 that uses framesets
and you can follow the code here: ../www/chat/jschat.tcl
All you need is the some code in this module to play a sound.
In the "old" days, we used the teletype BELL charater which
is a Ctrl-G or character 07. I don't think that this works
any more...unless you connect your pc to an old teletype machine!
-Bob