Elgato Stream Deck Default Audio Device Switching

Elgato Stream Deck Default Audio Device Switching

Another handy use I've found for the Elgato Stream Deck is toggling quickly between my headphones and my speakers as my default sound device. Prior to whipping up a couple buttons for this, I'd have to click through the systray to audio devices and then select and change my default, not exactly convenient and something I found myself doing quite frequently. Fortunately, using nircmd (http://www.nirsoft.net/utils/nircmd.html), which I previously used to launch batch windows silently and play sounds from my Stream Deck, this is pretty easy to accomplish.

Step 1.) Download NirCmd

Download NirCmd from http://www.nirsoft.net/utils/nircmd.html (the links are at the bottom of the page in text, there's a 64bit and 32bit version available). Extract the zip file that downloads to a directory on your PC (I used c:\nircmd for simplicity).

Step 2.) Find the exact names of your devices

From the system tray, right-click the sound icon and select Playback Devices. You'll be presented w/ a list of sound devices available on your PC.
Windows Playback Devices Control Panel The devices I want to swap between are named "Headphones" and "Soundbar" in the above screenshot. You can change these names to whatever you like from this panel by double clicking the entry and editing it in the popup.

Step 3.) Create batch files

I want to swap between Headphones and Soundbar, so I need 2 scripts, SetAudioHeadphones.bat and SetAudioSoundbar.bat.
SetAudioHeadphones.bat

SetAudioHeadphones.bat C:\nircmd\nircmd.exe setdefaultsounddevice "Headphones" 0
C:\nircmd\nircmd.exe setdefaultsounddevice "Headphones" 1
C:\nircmd\nircmd.exe setdefaultsounddevice "Headphones" 2

SetAudioSoundbar.bat C:\nircmd\nircmd.exe setdefaultsounddevice "Soundbar" 0
C:\nircmd\nircmd.exe setdefaultsounddevice "Soundbar" 1
C:\nircmd\nircmd.exe setdefaultsounddevice "Soundbar" 2

Step 4.) Wire up to Stream Deck

To fire off these batch files you'll need to create a new "Open" button from the System button collection in the Stream Deck Application. In the App / File: field enter <path to nircmd>nircmd.exe exec hide <full path to your batch file> the path to your batch file. Your button should fire properly. If you have any trouble getting the Open button to work properly, try adding 2>&1 > <path to a folder on your system>\output.log to capture the command line interactions to a log file to debug.

Related Article