title: Programmatically switch audio devices on Windows 7
body: <p>On my Windows 7 PC, I've got a set of speakers, some wireless headphones and a USB web cam. This means that I have two possible audio output devices and 2 possible audio input devices.</p>
  
  <p>I find myself having to switch between them fairly frequently. At the moment this is a manual process: right-click on the speaker icon, choose one of "Playback devices" or "Recording devices", choose the correct device in the list (and there's some "dead" ones in there, too) and then hit "Set Default".</p>
  
  <p>I've looked around, and all I can find are people scripting <code>SendKeys</code> to automate this.</p>
  
  <p>That sucks.</p>
  
  <p>Is there anyway to programmatically switch audio input/output devices, so that I can write a simple tray app/hotkey app to make this easier?</p>