Ever find yourself with your iPod and no way to actually hear it? Have a laptop with a linux distro on it? All you need it a standard 1/8′ mini stereo cable (on both ends) and you can have your laptop act as a play-through device under Linux.
Having recently received an iPod, I cruised in to work enjoying my music collection with the iPod connected to the AUX port on my car via a standard 1/8″ mini stereo cable (like the headphone connection, but on both ends of the cable).
I walked in to work, powered on my laptop, only to realize I left the USB cable at home. Ugh. And no external speakers. Ugh. And I didn’t have the ear buds. Ugh. There was no available way to actually listen to what was on the iPod. I did have the pass-through cable from the car, and this laptop has a microphone jack, so I knew this could somehow be done. I tried a couple of player applications, but those were more complex than what I needed and they were unable to set up the microphone jack as a pass-through device to the speakers. After a little digging, the solution presented itself in the most simplistic manner: I realize that I could use ‘rec’ to record the input from the microphone to standard output and pipe it to ‘play’ to simply output it to the speakers. Viola! It works.
rec -r 44100 -t wav -q – | play -t wav -q –
The one thing to be aware of is that you will need to unmute your microphone input. By default, most Linux distributions have it muted by default.