Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a headset with a built-in microphone, and a set of speakers with a Blue Yeti microphone, all connected to a Windows 7 PC.

I'd like to be able to switch between the headset mic/speakers and the Yeti mic & speakers without having to go into the Sound options and manually swap out the default audio device and default communications device.

I've Googled for software to do this, but haven't found any results that work for microphones/recording devices. Is there software that'll do this, or is this something I'll have to look into writing for myself?

share|improve this question

3 Answers 3

Nircmd's setdefaultsounddevice command should help you:

nircmd setdefaultsounddevice [Device Name] {Role}

Set the default sound device on Windows 7/Vista/2008. The [Device Name] is the name of the device, as it appears in the sound devices list of Windows, for example: Speakers, Line In, Microphone, and so on...

The {Role} parameter is optional and may countain one of the following values: 0 for Console (the default value), 1 for Multimedia, and 2 for Communications.

Examples:

setdefaultsounddevice "Line In"
setdefaultsounddevice "Microphone" 2

You can easily create a shortcut for this manually or using either cmdshortcut or cmdshortcutkey.

This AutoHotkey forum thread also contains scripts that you might find useful.

Finally, Set Sound Device is a compiled AutoIt script that helps you do the same thing:

SSD enables you to change the default Sound Device for Win7 (works maybe for Vista too, but this is untested) via the commandline. To call SSD from the commandline, the syntax is ‘SSD.exe #’ (where # is the number of the Sound Device to select from the list,’Select Default’ dropdown box must be enabled to make device selectable).

1

share|improve this answer

Use AutoIt and compile your own .EXE to automate the swap process.
Bind a shortcut to that .EXE for more comfort.

This script does exactly the same as you do when you manually swap your devices but only with the your keyboard instead of a mouse.

How to use

  1. Download & extract the AutoIt Self Extracting Archive
  2. Copy & Paste this code to a new text file

    Run("c:\windows\system32\control.exe mmsys.cpl")
    WinWaitActive("Sound")
    WinSetOnTop ("Sound","Sound", 1 )
    
    ;Toggle between sound device 1 and 2
    send("{DOWN}")
    if ControlCommand("Sound", "", 1002, 'IsEnabled') Then
        ControlClick("Sound", "Set Default", 1002)
        $message = "Headset 1"
    else
        send("{DOWN}")
        ControlClick("Sound", "Set Default", 1002)
        $message = "Headset 2"
    EndIf
    
    ;Toggle between microphone device 1 and 2
    Send("{TAB 5}")
    Send("{RIGHT}")
    send("{DOWN}")
    if ControlCommand("Sound", "", 1002, 'IsEnabled') Then
        ControlClick("Sound", "Set Default", 1002)
    else
        send("{DOWN}")
        ControlClick("Sound", "Set Default", 1002)   
    EndIf
    
    WinClose("Sound")
    TrayTip("", $message, 5)
    Sleep(2000)
    
  3. Save it as deviceswapper.au3
  4. Open AutoIt\install\Aut2Exe\Aut2exe.exe and convert your .AU3 file to a .EXE
  5. Create a shortcut to that .EXE and set up a suitable shortcut key

Note: On localized Windows versions (German, Spanish, French etc.),
you have to replace the string Set Default with your localized button text.

Here you can read more about all used commands.

share|improve this answer
    
You may have to alter the code if you have more than 2 devices in your sound or microphone list. Let me know if this is the case. –  nixda Jul 9 '13 at 22:45

Here's what I ended up doing, taking components from each of the above answers, and rolling it into an AutoHotKey script. I placed nircmd into C:\bin (really, anywhere in the system path would've worked), but the rest should be pretty self-explanatory.

; This sets it to desktop speakers, so that the toggle works correctly
; without having to detect the setting from system
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop" 2
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop Mic" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop Mic" 2

DesktopSpeakersActive = 1

; Change this to change which key this is bound to
Pause::
if DesktopSpeakersActive = 0
{
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop" 2
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop Mic" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Desktop Mic" 2
DesktopSpeakersActive = 1
TrayTip, , Desktop Speakers
}
else
{
Run C:\bin\nircmd.exe setdefaultsounddevice "Headset" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Headset" 2
Run C:\bin\nircmd.exe setdefaultsounddevice "Headset Mic" 0
Run C:\bin\nircmd.exe setdefaultsounddevice "Headset Mic" 2
DesktopSpeakersActive = 0
TrayTip, , Headset Speakers
}
return
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.