A hotkey to switch between headphones and speakers. Soundswitch.

I use USB headphones. I also use regular speakers connected to my sound card. Windows makes it a multi-step process to switch from headphones to speakers.

I tired of this, so I wrote a program to rectify the situation and I called it Soundswitch because I’m a wordsmith. You can find this program here:

Available here.

Basic Use and Installation

Unzip it to the directory of your choice.

Look in the Sound applet in control panel to see which two sound devices you want to switch between. In the following image, the two I switch between are labeled 1 and 4. Thus, in the ini file, I used 1 for Source1 and 4 for Source2.  Update:  Note that the number of items will vary based upon whether you have “Show Disabled Devices” and “Show Disconnected Devices” checked (Right click anywhere in the list to see these).  For the purposes of Sound Switch make sure both options are checked before counting the items. The screenshot below doesn’t reflect this.

sound_panel

The ini by default has the switch key assigned to Ctrl-Alt-F12. Edit this as you like.

Tested on Win7 x64 and Vista x32.   Update:  XP no longer works with the latest updates.  Use this older version for XP compatibility:  soundswitch

Any comments on this are welcome and I’ll try to fix any bugs reported.

Version 2 Notes

I’ve added a good number of features in the latest version. All accessible through the .ini file.

  • “Scroll” through each enabled item in your Sound panel.
  • Hide the tray icon
  • Switch between two speaker configurations for your current active playback device
  • Switch/scroll just the default comm device, default playback device, or both
  • Hotkey to terminate the program
Leave a comment ?

291 Comments.

  1. Sweet stuff here!!!

    To bad with software like skype you have to go in to options to change the devices 🙁

  2. Excellent stuff,
    Just what I was looking for

    Many thanks

  3. This is great. Is this possible in Windows XP?

  4. This is great. Is this possible in Windows XP?

    Look two paragraphs below the screenshot up above.

  5. Doh! Thanks…

  6. SWEET software. Have been looking for something like this forever. Thank you!

  7. I’m getting this error on execution

    “Error setting SwitchSpeakerCount to ^!{F9}.”

    (i’m on win7)

  8. What happens if you try a different hotkey?

    same error regardless of which hotkey I try 🙁
    even when run as admin…

  9. same error regardless of which hotkey I try 🙁
    even when run as admin…

    Which version of Win7 are you running? One of the beta versions? The RC? RTM?

  10. @iamjamie: Try this version. I was able to reproduce your bug on Win7 RC and I think I’ve fixed it. Let me know if it works for you.

  11. Hey. I’ve given this a shot on the new Windows 7 Enterprise Trial (RTM), and I can’t get it to work.

    In my Playback Devices, with everything set to Visible, Item 1 is my Speakers, Item 2 is my Headset, and Item 3 is my SPDIF Out.

    Using v2.011, when I hit the SwitchDefault hotkey (ctrl+win+F12), it successfully switches to Item 2 (Headset), but I can’t switch back to Item 1 with any subsequent keystrokes. It just flickers and stays on the Headset.

    I tried v2.02 from your post on the 9th, but it doesn’t even do anything at all when I hit the hotkeys.

    Any ideas?

  12. Greg, I just updated to Windows 7 RTM myself. I’m seeing a few issues with Soundswitch as well. I’ll troubleshoot them over the next few days and release an updated version ASAP.

  13. Good to know. Thanks Dustin.
    I’ll keep following here.

  14. I’d really like this but it seems to conflict with Logitech’s Setpoint keyboard/mouse software. When using the keyboard shortcut to switch device it locks my CTRL/ALT keys down and makes everything ctrl-alt clicks or keypresses. It also really screws with the accuracy of my mouse, even after closing it, my mouse was really jumpy.

    Actually, It may not be a problem with the setpoint software and more to do with the wireless keyboard/mouse drivers in Windows 7 RC build 7100.

  15. Thanks a lot for this tool! I got the same problems as Greg in Win7 Prof. 64bit though, so I’m waiting for an update. 🙂

    Windows 7’s multi-step process with switching these two devices is really awkward. In Vista I didn’t have this problem because headphones and speakers were considered to be “one device” and were playing back everything simultaneously. Not optimal either, of course (in case you wanted to switch from stereo to 5.1, for example), but at least I could simply turn off the speakers if I needed to.

  16. Having the same problem – getting the described errors even with v2.02. Win 7 Ultimate 64 Final.

  17. We’re getting ready to have a baby this week and I’ve been super busy with getting stuff ready for that so I haven’t had a chance to update this yet.

    I’ll really try to get it done this week!

  18. Hey, no worries! Congratulations and best wishes to you and the missus.

  19. I haven’t forgot about this. I fooled around with it a bit yesterday and figured out what I think is the problem.

    I’ll have to work on it some more, though.

  20. Ok, I think I’ve got the issues ironed out. Check at the beginning of the post for a download link for version 2.03

    Let me know how it works for you!

  21. Works. Thanks a bunch! Pure bliss! 😀

  22. That does it, Dustin.
    Thanks so much for your effort!

  23. Dustin: thanks so much for this great app – its exactly what I was looking for.

    Quick question – I am using an hp media center remote and wanted to use a key on there to switch sound sources.

    I was thinking about programming the hotkey to activate when I press * and # at the same time, I typed:

    SwitchDefault = +3+8

    But it will active when I type only #, and not both at the same time. Any suggestions on this? Any other unused button on the remote would work too – I just figured this would be the easiest to program.

    Thanks again!

  24. @Mike:

    I’m not sure how your remote works, but if it sends emulated keyboard commands, any key combo should work with one caveat. Your remote may not be capable of sending two “keystrokes” at the same time.

  25. Hey, great app!
    2 Quick questions:
    To run this on startup, do I simply drag the app and the cfg into my startup folder?

    Secondly: I wanted to know if it was possible to set this app up to run with the Fn functions on my keyboard, so I could set it for ex: to Fn and f12
    OR
    Set the app up to work the the built in hotkeys on my keyboard.

    Thanks!

  26. @Everlong: I normally make a shortcut and drag it into the startup folder. I guess you could drag the app and it’s cfg there, instead.

    To use a function key like F12 you use {F12}.

  27. Thanks Dustin, you’re the best!

  28. doesn’t work, just opens the sound dialog, flickers, and doesn’t change output

  29. @Anonymous:

    Sounds like you haven’t configured the .ini file.

  30. Mapped this right to one of the special function keys on my Logitech keyboard. Works great. Thank you!

  31. wow I’m glad I found this. switching devices all the time was starting to bug me. great script!

  32. i have the same problem as anonymous:
    when i select the hotkey, it just shows sound configuration and stays stick to default audio output.

    tried to change the .ini file with different source numbers, as i read the disconnected source warning, but no luck.

    i use windows 7 ultimate, italian edition; creative headset wireless hs-1200 and integrated audio.

    thanks for your work,

    mm1

  33. @emmeemmeuno: Does the sound configuration stay up on the screen or does it disappear?

  34. @dustin: it stays up on the screen, as if the keystroke just recalls the config panel, not changing anything in it.

  35. @emmeemmeuno: I haven’t forgot about you. I’ve just been busy with another project.

    I’ll look into your problem more as soon as I can. Feel free to remind me if I haven’t responded before the end of the year.

  36. Since i have the same problem as Anonymous and emmeemmeuno i would like to remind you =).
    I have deactivated and disconnected devices shown and they are in sum 5. my stereo would be 2 and headset 5. 1 and 3 are disconnected. maybe this helps.
    Other thought would be that some relevant audio service isn’t running?
    thanks for your concern

  37. @Skince: Thanks for the reminder. I had forgotten.

    I’ll definitely work on this later tonight or tomorrow and see if I can figure something out.

  38. To anyone having the problem with the hotkeys just bringing up the config panel…

    Do any of the hotkeys work? Do all of the switching and scrolling hotkeys bring up the config panel?

  39. quitting works and all other bring up the config panel

  40. @Skince: What are the specs on your computer? Memory and CPU is what I’m most interested in knowing.

  41. CPU: AMD Athlon 64 X2
    RAM: 2GB ,DDR2 i guess
    And Windows 7 Ultimate 32bit

  42. ok, same for me: config panel.

    my config:

    CPU: Intel Core2 Quad Q9550
    RAM: 2x2GB DD3
    W7 Ultimate 32 bit

    do you need mobo specs or similar?

    cheers,

    mm1

  43. Is that coded in python?
    I would be interessted in source if you give it away and could help troubleshooting =)
    Also if i run the program through command line, it gives an error that Sound_switch.ini cannot be located in [the place it is]

  44. This is a great little app, thanks! I am always switching between headphones and speakers, this makes it a lot quicker.

  45. Thanks, this is very helpful! I’ve just added a Communicator phone to my devices, and am not sure how the Speakers section should be set in the .ini file. Since the phone appears as #1 in my device list now, in addition to my headphone and stereo speakers, would I edit the Speakers values as follows?

    [Speakers]
    Set1 = Mono
    Set2 = Stereo
    Set3 = Stereo

    More generally, could you provide a brief description of each configurable line of the .ini file? I’d love to get a bit more clarity on the expected action of each hotkey, for example.

    Again, thanks for the work you’ve put into this!

    -Chris

  46. @Chris: I haven’t touched the code for this in ages.

    IIRC, you can only have two speaker sets.

  47. Just wanted to say THANK YOU! This made it super easy for me to game on my HDTV…

    Here’s the setup…

    Used UltraMon to setup 2 display profiles. Pro1 has the TV output (HDMI from ATI Card) disabled. Pro2 Has HDTV enabled and default monitor. Setup UltraMon to use a hotkey to switch between the two.

    Then I used this utility to switch to the HDMI audio output once it was activated by UltraMon’s 2nd display profile.

    Everything tested great – SWEET! Thanks!

Trackbacks and Pingbacks: