How to make terminal bell play an alert sound without PC speaker?

How can I get the terminal bell to play an alert sound out of the regular speakers (not the PC speaker)? I have irssi set up to beep for various IRC events, but nothing happens because the beep uses the terminal bell.

Also, see my related question about visual alerts.


Edit ~/.xprofile and add the line pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg. Then when you log out and log back in, typing echo -e '\a' in the terminal will play an alert sound (glass.ogg). Then I copied bell.ogg (found with locate -i bell.ogg) to the same folder as glass.ogg and modified the above command to use bell.ogg instead. Then, you can adjust the alert volume in Sound -> Sound Effects tab.

This solution worked on Ubuntu 12.10 Quantal Quetzal 64 bit with 3.5.0-22-generic. It's from http://www.richud.com/wiki/Ubuntu_Beep_Audible_Bell_Ping_Fix.