28 August 2010

File this one under “Obvious solutions that I somehow hadn’t figured out until just now.” I’m a heavy user of the excellent Pianobar command-line Pandora client, and in the past have often wanted to stream its audio to my Airport Express using Airfoil. Until now, I had been unable to do so, as Airfoil’s UI for selecting the application from which to stream audio (its “choose application” dialogue box) only supports OSX “application bundle”-style executables by default.

It turns out that there is a way to tell Airfoil to capture audio from console applications (something involving holding down the option key when you click on the source drop-down menu, etc.), but that only solves part of the problem: Airfoil can’t seem to capture the audio from a running Pianobar process, and so you have to let it launch a new process… at which point you’re stuck. Since pianobar is a console application, launching it via Airfoil won’t give you any way to interact with it (e.g., to select which station to play, etc.).

There are two solutions. The first is to use Pianobar’s config file to set up an autostart_station (clunky, but workable). The other is so obvious that I’m more than a little embarrassed that it took me so long to hit upon it: just tell Airfoil to capture the audio output from Terminal.app. Problem solved.