Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: switching between speakers and headphones


03 Aug 2011   #1

Windows 7 Home Premium 64 bit
 
 
switching between speakers and headphones

My old computer only had one audio output, so I wired it to a toggle switch under my desk so in the up position the audio was connected to my speakers and in the down position the audio was connected to my headphones. The drawback was that if I moved the switch to within easy reach my knee would bang into it every now and then.

My new computer (with an Asus P8Z68-Vpro MBD) has two headphone jacks (front and rear) as well as separate jacks for the speakers, so I'm hoping I can hook it up without using this switch. I don't want to be plugging and unplugging into headphone jacks all the time however. I would like to use one of the keys on my keyboard ideally. I have the Microsoft Wireless Comfort 5000, so there are volume up/down buttons and a mute button. The mute seems to mute both headphones and speakers however, where as I would really only want it to mute the speakers. (Actually I can get only speakers or headphones to work, but not both. Although this is not really a problem since I only need one or the other to work like it did with my old switch).

There is also a button on the keyboard with a picture of a headphone would seem to make perfect sense for purpose. (The default set up by the keyboard driver is to start the media player when you hit that button, but I assume I could use it to start whatever program or batch file I wanted to).

I explored the Realtek HD Audio Manager a bit, but I didn't see an obvious way to do what I want. I tried googling the topic but I found only confused and/or confusing descriptions of the whole mess. Am I trying to do something unusual here? I mean, I do live with other people and I can't very well pipe my audio into my speakers all the time. Sometimes there are even sleeping people in the house. I would think many people are in the same boat, no?

If you tell me the only way is to hook up my old toggle switch the way I did before, I will do that ... but I will still be incredulous if all this sophisticated looking audio software and hardware can't already do this with the click of a button.

Thanks in advance for any advice you can offer.

~Paul

My System SpecsSystem Spec
.

04 Aug 2011   #2

win7 ultimate 32bit
 
 

"Actually I can get only speakers or headphones to work, but not both. Although this is not really a problem since I only need one or the other to work like it did with my old switch"


what you describe is the way it is supposed to work--you plug in your headset--the speakers shut off
My System SpecsSystem Spec
04 Aug 2011   #3

Windows 7 Home Premium 64 bit
 
 

Quote   Quote: Originally Posted by tman69 View Post
what you describe is the way it is supposed to work--you plug in your headset--the speakers shut off
What you say is true, however I believe that is optional. At least I see in the advanced settings that "Mute the rear output device when a front headphone plugged in" is an option you can turn on or off". But in any case that is not my question which perhaps you didn't understand. My fault I guess for writing too much verbiage ... so I will say it more concisely:

"How do I switch the sound from headphones to speakers and back again using the keyboard?".

If you are questioning why I would want to do this ... isn't the keyboard (or sometimes the mouse) the main way to get the computer to do what we want it to do? Sure I could do this by plugging and unplugging the headphone plug into the front panel jack, but that would be a lot harder on the headphone cable, and a lot slower as well. (Just finding the end of the headphone cord would take longer than pressing the appropriate key).

~Paul
My System SpecsSystem Spec
.


04 Aug 2011   #4

win7 ultimate 32bit
 
 

My System SpecsSystem Spec
08 Aug 2011   #5

Windows 7 Home Premium 64 bit
 
 

Quote   Quote: Originally Posted by tman69 View Post
Thanks for the suggestion, although I can't get it to work.

I have figured out a way to switch the sound between speakers and headphones however. Right clicking on the volume control icon in the system tray, and selecting "playback devices" gives me the panel that I've attached to this message. I can highlight either of the top two choices (with the icons of the speaker and headphones respectively), and click on "Set Default", and ... Bingo. The sound instantly switches to the device I selected. (I don't even have to restart the media player for example). So this is great ... except that it takes 50 times to many mouse clicks. I want a way to do it via a single mouse click or keyboard key.

I realize that your suggestion (QuickSoundSwitch.exe) should allow me to do this, however when I run it and click on its icon in the system try, I see my 4 sound devices, and can put a checkmark next to any one of them ... yet this has absolutely no effect on the sound system. All it seems to do is move the check mark around!

I also tried a similar program called STADS (System Tray Audio Device Switcher). I had the exact same problem with this program. I can select any of the audio devices, but it changes absolutely nothing.

I also tried the command line versions of both of these programs (ulitmately I'll want to assign one of these command lines to a keyboard key), but the commands also had no effect.

This looks so simple it almost has to work ... yet it doesn't. So close yet so far.

Anybody have any ideas why I can't get either of these programs to work?

Since it works from the playback devices sound panel itself, another approach would be to write a macro to open this panel, select the desired output device and hit the "Set Default" button. I'm unfamiliar with windows macros however. Is there a macro generating program which is sophisticated enough to do such a thing without a huge programming effort?

Thanks
~Paul


Attached Images
 
My System SpecsSystem Spec
08 Aug 2011   #6

Windows 7 Home Premium 64 bit
 
 

Ok, here is an update. I still haven't figured out why I couldn't get those playback device switchers to work, but I was able to create my own. I downloaded the free autohotkey utility and then I used it to convert the script below into an exe which I then assigned to the headphone key on my keyboard. This script toggles between the 1st and 2nd devices in the playback devices list. The script itself I copied from someone who posted it on the autohotkey forum. Note if you want to switch between the 1st and 3rd device instead, then simply change the second occurrence of {Down} to {Down 2}.

------------------------------------------------------------------

; This will set the first device active if it isn't already.
; If the first device is active then it will activate the 2nd device.
; Once a device is picked it plays a sound so you know which device is selected.

Run, mmsys.cpl
WinWait,Sound
ControlSend,SysListView321,{Down}
ControlGet, isEnabled, Enabled,,&Set Default
if(!isEnabled)
{
ControlSend,SysListView321,{Down}
}
ControlClick,&Set Default
ControlClick,OK
WinWaitClose
SoundPlay, *-1
return
My System SpecsSystem Spec
06 Sep 2011   #7

win7/xp
 
 

Isn't it absolutely mind boggling that in 2011, something as simple as switching between default devices via a shortcut, when the system is MADE to support multiple devices, is at best impossible to do and at worst, shockingly taken back to 1984 when you needed to code macros to automate things because no one had bothered to consider the OS should have that ability builtin... and we forgave them.. it was 1984 afterall.

This, and the fact we cannot mute WMC alone, and have to mute the entire system if not at the PC. And there is apparently no way to programatically target that device audio alone... magic.

God I miss the days when we could program devices directly without the HAL setting up rubbish dead ends for no seemingly good reason.

When you click "Set as default" and the audio changes instantly to the newly selected device, THERE IS SOME MESSAGE BEING SENT to do it... why is this a secret I wonder... it must be doable via proper direct coding.
My System SpecsSystem Spec
Reply

 switching between speakers and headphones




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:05 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33