22

I want an easier way to change my default sound device from my sound card to my usb headset.

Currently it takes a very precise right click, a left click, another right click, and two more left clicks.

Ideally i could just have it swap with a shortcut key. (it was a little easier in XP but not by much.)

A software solution is preferred, but I am open to suggestions that use hardware.

I am running Windows 7 currently.

1
  • Tell me about it! And Windows is supposed to be designed for ease-of-use. Pfft Commented Jul 25, 2012 at 14:06

5 Answers 5

17

Free and open-source: SoundSwitch

enter image description here

2
  • 2
    Looks like the original author, Jeroen Pelgrims, handed development over in August 2015 to Antoine Aflalo who updated it for Windows 10 and moved the development activity to Belphemur/SoundSwitch on github. Commented Mar 7, 2016 at 21:04
  • 1
    This is a great program. One tip: You can rename your sound devices from 1) Run c:\windows\system32\control.exe mmsys.cpl 2) Right click your sound device -> Properties. The new names will be updated to SoundSwitch after you restart the program.
    – Niko Fohr
    Commented Jul 10, 2016 at 15:10
14

I use NirCMD, a nifty command-line tool which allows you to edit a lot of windows settings using a script.

In this case, that would be

nircmd.exe setdefaultsounddevice "USB Headset"

I use it to switch my main monitor to be my TV, and output the sound over HDMI to that device:

nircmdc.exe setprimarydisplay \\.\DISPLAY7
nircmdc.exe setdefaultsounddevice "SONY TV-4"
9

Use AutoIt

The main advantage is that you don't have to install any software. It works out-of-the-box. After you've created the tool place a shortcut on your desktop to toggle your devices.

How to set up

  1. Create a new text file with notepad and copy & paste the code

    Run("c:\windows\system32\control.exe mmsys.cpl")
    WinWaitActive("Sound")
    WinSetOnTop ("Sound","Sound", 1 )
    send("{DOWN}")
    if ControlCommand("Sound", "", 1002, 'IsEnabled') Then
        ControlClick("Sound", "Set Default", 1002)
        $message = "Speakers"
    else
        send("{DOWN}")
        ControlClick("Sound", "Set Default", 1002)
        $message = "Headset"
    EndIf
    WinClose("Sound")
    TrayTip("", $message, 5)
    Sleep(2000)
    
  2. Edit line 4 and 8 send("{DOWN}") to your needs. The example code above only toggles between device #1 and #2. You have to edit two lines to your needs. See my explanations below.

  3. Replace "Speakers" and "Headset" with your correspondig device name or something similar
    Later, this hint will be shown in your tray for 5 seconds if you toggle sound devices

  4. On non-English Windows versions you have to replace Set Default in line 6 and 10 with your localized button text
    enter image description here

  5. Save the file as something.au3

  6. Download the zipped version of AutoIt and extract it. Go to subfolder Aut2Exe and start Aut2exe.exe to convert the .AU3 script to a .EXE file. You're done

Reference to all AutoIt commands


Or use AutoHotKey

It's basically the same, only with AutoHotKey. The key binding is done right in the script with #!z which means, every time you pressy Alt+Win+z you switch between your device #1 and #2.

How to set up

  1. Paste the code below to a text file and save it as SoundToggle.ahk

    #!z::
    Run, c:\windows\system32\control.exe mmsys.cpl    
    WinWaitActive, Sound
    WinSet, AlwaysOnTop, On, Sound    
    Send, {DOWN}    
    ControlGet, MyState, Enabled, , Button2
    If (MyState = 1){
        ControlClick, Button2, A
    } Else {
        Send, {DOWN}
        ControlClick, Button2, A
    }    
    WinClose, Sound        
    return
    
  2. Download AutoHotKey (Unicode 32-bit) and extract AutoHotKey.exe

  3. Create a shortcut to that .EXE and modify the target line according to your own paths

    "C:\myfolder\AutoHotkey.exe" "C:\myfolder\SoundToggle.ahk"
    
  4. Move the shortcut to your startup folder


How to edit send("{DOWN}") lines

Open your sound panel with Win+R and enter control mmsys.cpl sounds. You want to know how many times you have to press the DOWN key to get to your first sound device and how many times to press DOWN again to reach the second device.

For example, to toggle device #3 and #5 you have to press down three times send("{DOWN 3}") and press down again two times send("{DOWN 2}") more to reach the fifth device (3x down + 2x down = 5th device). You get the idea.

enter image description here

2
  • Autohotkey is really neat. Just a note that it might require a sleep, 100 between sending the {Down} key and doing a ControlGet. My script didn't recognise the Enabled status correctly otherwise.
    – Wizongod
    Commented Apr 4, 2016 at 15:42
  • Also you have to install Autoit and also code the script, I think first solution is way easier and practical.
    – arana
    Commented Mar 24, 2017 at 20:12
8

This app called "Coastal Audio Changer" should work for Windows 7. As of 2012 it has a free trial and is $3 to purchase. The author, Andrew Bailey, hosts the trial and purchase links on this dedicated Coastal Audio Changer website.

3
  • 1
    i ended up using the trial of this app and then buying it. It was a little buggy at first, but then the author released a new version in April 2011 and now I love it. it's perfect and totally worth the 5 bucks. :) Commented Jul 27, 2011 at 20:26
  • 7
    Using this now because it's simpler, works better, and is open source: soundswitch.codeplex.com Commented Mar 10, 2013 at 6:40
  • 2
    Could you summarize the solution here? When that link dies (when, not if) your answer will become useless. Commented Jan 7, 2016 at 19:09
0

You can use the latest development in audio output device switching technology that I created:

Micro Audio Switcher

Features:

  • It has no tray icon to uselessly sit in it most of the time
  • To cycle between audio playback devices you just press Middle Mouse Button on the default tray sound icon, as simple as that
  • Optionally you can also enable very powerful SINGLE key global hotkey and remap ANY key (excluding ones like FN, that don't send any signal to OS at all when pressed alone)
  • Bonus feature: you can change sound volume level of active device by hovering mouse over the sound icon and rotating the mouse wheel!
  • Bonus feature: you can mute/unmute active device by long-pressing Middle Mouse Button over the sound icon!
  • Uses miniscule amount of RAM and only uses tiny amount of CPU when you move mouse over the Taskbar, otherwise uses no CPU at all.

Tested on Windows 10 21H2, but I guess should also work in W11/W7.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .