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:

soundswitch_v2.03 – (latest version)

sound_switch_v2.01

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
Tags: ,

Related posts

83 Comments

thegreyspot  on June 3rd, 2009

Sweet stuff here!!!

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

Contriving » My program for hotkey switching between speakers and headphones…  on June 17th, 2009

[...] …has been updated. [...]

Totalchaos  on June 19th, 2009

Excellent stuff,
Just what I was looking for

Many thanks

Dustin  on June 20th, 2009

Glad I could be of service. :)

elguapo42  on July 15th, 2009

This is great. Is this possible in Windows XP?

Dustin  on July 15th, 2009

This is great. Is this possible in Windows XP?

Look two paragraphs below the screenshot up above.

elguapo42  on July 15th, 2009

Doh! Thanks…

maz  on July 25th, 2009

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

iamjamie  on August 8th, 2009

I’m getting this error on execution

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

(i’m on win7)

Dustin  on August 9th, 2009

I’m getting this error on execution

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

(i’m on win7)

What happens if you try a different hotkey?

iamjamie  on August 9th, 2009

What happens if you try a different hotkey?

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

Dustin  on August 9th, 2009

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?

iamjamie  on August 9th, 2009

win7 RC

Dustin  on August 9th, 2009

@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.

Greg  on September 4th, 2009

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?

Dustin  on September 5th, 2009

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.

Greg  on September 9th, 2009

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

Mike  on September 11th, 2009

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.

Arhu  on September 13th, 2009

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.

Brian  on September 27th, 2009

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

Dustin  on September 27th, 2009

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!

Greg  on September 28th, 2009

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

Dustin  on October 5th, 2009

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.

Dustin  on October 7th, 2009

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!

Arhu  on October 7th, 2009

Works. Thanks a bunch! Pure bliss! :D

Greg  on October 7th, 2009

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

Mike  on October 21st, 2009

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!

Dustin  on October 23rd, 2009

@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.

Everlong  on November 3rd, 2009

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!

Dustin  on November 3rd, 2009

@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}.

Everlong  on November 3rd, 2009

Thanks Dustin, you’re the best!

Anonymous  on November 14th, 2009

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

Dustin  on November 14th, 2009

@Anonymous:

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

Informis  on November 22nd, 2009

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

xantus  on December 15th, 2009

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

emmeemmeuno  on December 15th, 2009

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

Dustin  on December 15th, 2009

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

emmeemmeuno  on December 15th, 2009

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

emmeemmeuno  on December 22nd, 2009

@dustin: any idea?

Dustin  on December 22nd, 2009

@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.

Skince  on January 5th, 2010

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

Dustin  on January 5th, 2010

@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.

Dustin  on January 6th, 2010

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?

Skince  on January 6th, 2010

quitting works and all other bring up the config panel

Dustin  on January 6th, 2010

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

Skince  on January 6th, 2010

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

emmeemmeuno  on January 6th, 2010

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

Skince  on January 6th, 2010

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]

Fog  on January 7th, 2010

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

Chris  on January 11th, 2010

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

Dustin  on January 29th, 2010

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

IIRC, you can only have two speaker sets.

None  on February 10th, 2010

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!

Skince  on February 14th, 2010

Little Remind =)

Dustin  on February 14th, 2010

@Skince: This is wrote in AutoIT. I’ll give some thought to releasing the source…

yauser  on February 15th, 2010

Works like a charm. Just what I was looking for to easily switch between headphones and speakers. Thanks for sharing.

Chris T  on February 23rd, 2010

Great solution that works.

Hawb  on February 24th, 2010

Perfect, thanks!

kaotik  on March 3rd, 2010

You are the best. Thanks

jonesy  on March 8th, 2010

life changing =) thanks

jjubic  on March 26th, 2010

Can you call it from a batch file used to launch an aplication.

Precedence  on March 28th, 2010

Truly Awesome, thankyou!

jojo  on March 30th, 2010

Thanks heaps, I am clickin up on your advert links to repay the favour, hope others do aswell.

Moris  on April 6th, 2010

Thanks a lot its working great :D

Grevy  on April 18th, 2010

Did you figure out how fix the thing where it just brings up the sound config page ?

Dustin  on April 19th, 2010

@jjubic: Not currently, but I’ll put it on my to-do list.

@Grevy: I cannot reproduce this bug, so I haven’t figured out a fix yet.

JimmyGourd  on April 28th, 2010

I like the concept of running from a batch/command-line as this would solve the very problem I was hoping your program would solve. However, the machine I’m working on is an XP machine. Any possibility this item could be XP-compatible, too?

Looks like a great tool, Dustin!

Greg  on June 9th, 2010

Thanks so much! This is incredible. This makes switching between my office and living room easy again. Really appreciate the work!

Shaun  on June 14th, 2010

Great little piece of software. It’d be great though if the icon changed to reflect what speakers/devices were active.
Thanks very much

Dustin  on June 23rd, 2010

I’ll add that to my features to-do list.

Mzdr.Moon  on July 10th, 2010

You, my friend, are awesome. Thank you for putting a tool like this out for all to use! I’m using this to switch between the speakers at my desktop and the surround sound of my receiver (sometimes my wife doesn’t want to hear the “noise” I’m listening to). BTW – running Windows 7 Pro.

Josh  on July 10th, 2010

This is exactly what I needed! I was just getting ready to dive into the Windows API to figure out how to write something to change my audio from 5.1 (speakers) to stereo (headphones). This saved me a bunch of time. I’d love to know how you did this.

Dustin  on July 13th, 2010

@Josh: The Windows API was too much trouble, so I just automated the Sound control panel applet UI.

I’ll be open sourcing the code sometime this summer so you’ll be able to see how I did it exactly soon.

Skie  on July 19th, 2010

Just FYI – the 2.03 version doesn’t work with Vista 64, but the XP-compatible version works like a charm.

3 Thumbs Up for this awesome little piece of software!

kp  on July 20th, 2010

Amazing application kudos to you for taking matters into your hands and sharing it with the world.

Anonymous  on July 27th, 2010

Dustin,
Does this work between Wireless headphones and wired speakers.
I can switch between the two if I am watching a video on youtube via the Sound Panel.
But when I am streaming a movie online, the sound will work with only the first device that is on for eg: If I have my Wireless headphone on, the sound will come thru it. If I have my wired speaker on, the sound will come thru it but will not revert.
Vista 64 Bit Home premium.

Josh  on July 27th, 2010

@Dustin: Glad to hear it.

@Anonymous with headphone problem: I think some programs have difficulty switching sound devices while they are already running. I don’t actually switch sound devices, but sound output (stereo/5.1), myself, so it might be similar.

For instance, if I have skype running with a call on and I’m on 5.1, I have to end the call in order to be able to switch back to stereo or skype freaks out and says it can’t find the sound device. Once I’ve switched, I can restart the call no problem and it will be on stereo.

So, if that’s the case, the problem is likely with whatever program/browser you’re using to stream your movie.

sarah  on August 3rd, 2010

can you talk me through how to do this on xp as i downloaded the xp one but dont know how to install and use it.

Las  on August 9th, 2010

Hi, first of all thank you Dustin for this.
I saw same issue as Anonymous reported, about screen flicking but nothing changing. I figured out it happens because I on windows 7 had disabled my other device.
So I just needed to have both enabled, but only one active (naturally) then it changes as it should.

And lastly would you consider adding quick change to the tray icon? I could use that when controlling only using the mouse while away from the keyboard.

But again, thank you. I think I can even instruct my wife on how to change the output now :)

br
Las

zanpaku  on August 11th, 2010

Well,
i’ve been using it for a few months now, without any problems.
But now it’s starting to bugg a bit.
Each time I press my hotkey to switch from headset to speakers, it buggs out a bit. I need to press it a couple of times before it switches back.
But this only happens from headset to speakers, not from speakers to headset where it works propperly.

Any thoughts would be great.

Dustin  on August 11th, 2010

I’m not sure. It shouldn’t matter which device you’re switching from/to since Soundswitch is just selecting items from a list and has no knowledge what kind of devices there are.

zanpaku  on August 12th, 2010

well,
that is what I guess.

BUt maybe it has artificial inteligence ^^

RS  on August 31st, 2010

I have extracted and run the legacy XP .exe file. It appears in the taskbar but Script Paused is checked and I cannot uncheck it. Any suggestions?

How to Quickly Switch Audio Between Speakers and a Headset [Windows] | 40Tech  on September 1st, 2010

[...] Soundswitch is a free program that allows you to set a hotkey to switch between audio output devices.  Soundswitch is pretty simple.  After you download the file and extract its contents to a location of your choosing, you then open up an .ini file (sound_switch.ini) to configure the program.  The configuration step is important – if you don’t do it, Soundswitch won’t work (unless your device setup happens to mirror the app developer’s setup). [...]

Leave a Comment