What I did on my vacation from reality

Home About RTL8187B Laptop Cam Quotes Login

February 1, 2009

STFU, Rhythmbox!

1:12 pm — Main

Ubuntu’s default music player for Gnome is Rhythmbox, in case you weren’t aware. It’s a decent enough player, though I’m told it fails at large collections, but I’m not here to plug it or rag on it.

One of its niftier features is software mixing. In other words, it can adjust the volume of the playing audio without adjusting the actual hardware volume levels for the soundcard.

This is cool for two reasons. First, there’s a CLI to get and set the player volume. It’s not very script-friendly, but it’s workable. Second, you can play something else at full volume while playing an mp3 at reduced volume.

For example, if your email client can execute a command when mail comes in, you can turn down the volume on the mp3, play a notification wav at full volume, and then turn the volume back up on the mp3. Mine happens to read a brief summary through the eSpeak speech synthesizer.

This program will turn the volume down on Rhythmbox, leaving the hardware volumes untouched and storing the volume for use by the second script. (more…)