Building on my last post on Linux sound hacks I’m including this little gem. It’s a little bash script I wrote that plays an input parameter through ALSA. If you disable the KDE sound system you can use this shell script to push system sounds through ALSA. It assumes aplay, oggdec, and mpg321 are installed on your system. (I don’t remember their respective packages but you can use Synaptic to find them.) Here’s the code:
case $1 in
*.ogg) oggdec -Q -o - "$1" | aplay -q &
*.wav|*.voc|*.wav|*.au|*.raw) aplay -q $1 &
*.mp3) mpg321 -o alsa $1 &
*) echo "unsupported file type $1"
To use it you have to save it somewhere on your system and make it executable. (I put mine in $HOME/bin and madify my environment so that $HOME/bin is in my $PATH. Use chmod +x on the command line to make it executable.) Next go into your “System Notification” settings dialog in KDE. In the lower right corner there is a player settings button. Key in the path to the file that you saved, hit apply, then hit ok and you’re all set. If you want you can easily compare the sound that the script gives you with the sound that the KDE sound system gives you (using the player settings dialog) to hear the difference.
In my experience the KDE sound system plays sound choppy and not as high quality as ALSA. I’ve also had far too many other issues when the Sound system was running than I care to explain. Try my hack and tell me what you think.