Friday, August 17, 2007

AMixer And Emacspeak: Controlling The Sound Card

In the days of OSS, Emacspeak had a nice Emacs-interface to aumix and it is a piece of functionality that I have missed even more under ALSA, given that one can do many more sophisticated tweaks to one's sound-card. Tool alsamixer --- a full-screen terminal application is bewilderingly confusing (at least to me), and amixer though usable required me to go find out how it worked each time I needed to do something new. The final straw came last weekend when I tried to record some Emacspeak demos using recordmydesktop and needed to configure ALSA so that it would capture sound directly from the PCM output, rather than the microphone.

To cut a short story even shorter, I ended up writing an Emacs wrapper around amixer called --- well, you guessed it, amixer. The code is checked in as amixer.el. The Emacspeak keybinding C-e ( formerly used to manipulate aumix is now ALSA-aware and will intelligently default to using the new amixer tool if /usr/bin/amixer is available.