Enter Search Query:

  • 6293
  • Close

Hotkey toggle the default audio output device

So I got this beautiful Sony TV and hooked it up to my work computer via HDMI. It’s great for watching movies and SageTV Client from my computer and every once in a while I even use it as an extended desktop. I also have a set of speakers on my desk that I use whenever I’m working and the TV is turned off. Whenever I enable the Sony as an extended monitor, it automatically sets the AMD HDMI Output audio device as my default audio device, however when I turn the TV off it doesn’t set my speakers back as my default audio output device. This is a problem because the TV is turned off a lot of the time and if the default audio device is still the TV, I won’t be hearing any voice mails while working. To fix this in the past, I’d have to go to mmsys.cpl and set my speakers back as my default audio output device. I finally sat down and tweaked an AutoHotkey script to do this for me. The script simply toggles between both Audio Output devices with a hotkey, so I can easily switch back and forth.

Here’s how:

[the problem]

When I extend my monitor to include the Sony TV, the AMD HDMI Output device is set as default.

But I want to switch back to the Speakers Output device without having to go to mmsys.cpl.

[the solution]

[step 1] Get AutoHotkey (if you don’t already have it). It’s free.

[step 2] Create a new text file anywhere you like and name it audio.ahk (make sure to change the extension from txt to ahk).

[step 3] Paste the following text into that file. Then Save and Close the file.

—————start copy below this line——————-

; This script will toggle your default Windows Audio Output device if you have 2 enabled audio devices.
; For more audio devices, contact me at http://davidvielmetter.com/contact/
; This script maps to Win+A hot key combo once activated!
Run, mmsys.cpl
ControlSend,SysListView321,{Up 2}
ControlGet, isEnabled, Enabled,,&Set Default
ControlClick,&Set Default

—————stop copy above this line——————-

[step 4] Double Click the file or right-click it and and select Run Script. NOTE: The A icon that should appear in your notification area. This indicates the script is running and awaiting your key presses.

[step 5] Type Win+a (the Windows key and the a key at the same time) to toggle between your default output audio devices.

That’s it.

April 25, 2012

Related Posts