Audio device switcher for Windows 7

Thanks for this, this looks very useful for me, I needed easy switching for analog out for blu rays and digital out for music from my htpc,
 
I have used your app as a base for an open-source project called AudioSwitch - it has some more good features which are useful - check it out:
audioswitch.googlecode.com
demo.png

Credits go to OP for nice GUI development ;)
 
Last edited:
I have used your app as a base for an open-source project called AudioSwitch - it has some more good features which are useful - check it out:
audioswitch.googlecode.com
demo.png

Credits go to OP for nice GUI development ;)

hey good work,

i have 3 screen, my taskbar is sideway on the right, your program appear on my main screen (the middle).

anyway you can fix?

thanks
 
hey good work,

i have 3 screen, my taskbar is sideway on the right, your program appear on my main screen (the middle).

anyway you can fix?

thanks

Thanks,

Can you please get a screenshot (of all 3 screens together like default screenshot is taken) while AudioSwitch menu is open, maybe with the screen properties window open also, so I could see your settings? And which monitors are secondary and which one Windows thinks is the primary one, and where it should appear then? Current code searches the tray icon and goes by it.
Of course if you have google account then you might be better off with creating an issue ticket there, so we wouldn't bloat this thread with issues belonging to another app :)
 
Thanks,

Can you please get a screenshot (of all 3 screens together like default screenshot is taken) while AudioSwitch menu is open, maybe with the screen properties window open also, so I could see your settings? And which monitors are secondary and which one Windows thinks is the primary one, and where it should appear then? Current code searches the tray icon and goes by it.
Of course if you have google account then you might be better off with creating an issue ticket there, so we wouldn't bloat this thread with issues belonging to another app :)

done, sir.
 
I have used your app as a base for an open-source project called AudioSwitch - it has some more good features which are useful - check it out:
audioswitch.googlecode.com
demo.png

Credits go to OP for nice GUI development ;)

Thanks you so much for this. :)

Do you know if it's possible to add a user defined key shortcut for quick switching between sources? Essentially what right clicking does, but with a global shortcut key, so i don't have to use my mouse.
 
Thanks you so much for this. :)

Do you know if it's possible to add a user defined key shortcut for quick switching between sources? Essentially what right clicking does, but with a global shortcut key, so i don't have to use my mouse.

I think it can be done, create an issue with the description and type it as a feature, I'll see what I can do ;)
 
Wow, I'll have to check this out when I get home. I've always been bothered by how annoying it is to switch my audio when going from using my PC at my desk to the TV and vice versa.

Thanks!!
 
I think it can be done, create an issue with the description and type it as a feature, I'll see what I can do ;)

To everyone interested, the Hot Key feature is added to the latest AudioSwitch v1.28 and works perfectly with any Ctrl/Alt/Shift + <key> combination :)
 
You bring the panel to view and hold for 3 seconds a hotkey of your choice (ctr +<key>, or alt + <key>, or shift + <key>). If successful, a popup will appear with the new hotkey. To delete the hotkey, you do the same (hold for 3 sec) but only pressing the DEL key.
 
Last edited:
Is there a way to get Audio Switcher to start up with Windows? And is there a way to have it save the hotkey preferences after you quit it?
 
Is there a way to get Audio Switcher to start up with Windows? And is there a way to have it save the hotkey preferences after you quit it?
AudioSwitch saves last applied hot key and re-applies it on startup. Last version v1.30 fixed a bug where it was sometimes not doing that. Go get it and see it work like a charm :)
 
sirWest, thanks for the audio switcher but I am managing to make it crash. It is some kind of .NET framework error: Error HRESULT E_FAIL has been returned from a call. Although it doesn't look like it will help, I've attached the details on the error below. (Note that the details were removed). It seems to occur whenever I right click on the icon in the taskbar. It switches the output to the first device in the list and then crashes the next time I left click on it to bring up the device listing.
 
Last edited:
It would help to get a screenshot of the opened list to see which types of devices you have. It might be related to some of your specific outputs. I also recommend to disable all unnecessary devices which you are not using for output so the quick-switch would be optimal and the list as short as possible and easier to navigate. This could also prevent these kinds of exceptions. In the future it's enough to see only the basic part of the exception (classes starting from AudioSwitch namespace) and not the full data, ie.
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRIn ternal(Int32 errorCode, IntPtr errorInfo)
at AudioSwitch.EndPoints.SetDefaultDevice(Int32 devID, EDataFlow renderType)
at AudioSwitch.FormSwitcher.notifyIcon1_MouseUp(Object sender, MouseEventArgs e)

Thanks!
 
It would help to get a screenshot of the opened list to see which types of devices you have. It might be related to some of your specific outputs. I also recommend to disable all unnecessary devices which you are not using for output so the quick-switch would be optimal and the list as short as possible and easier to navigate. This could also prevent these kinds of exceptions. In the future it's enough to see only the basic part of the exception (classes starting from AudioSwitch namespace) and not the full data, ie.
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRIn ternal(Int32 errorCode, IntPtr errorInfo)
at AudioSwitch.EndPoints.SetDefaultDevice(Int32 devID, EDataFlow renderType)
at AudioSwitch.FormSwitcher.notifyIcon1_MouseUp(Object sender, MouseEventArgs e)

Thanks!
 
Here is the screen of my devices and the error it gives. Note that it does seem to work just fine as long as I never right click on the icon. I don't see any way to close the software so I assumed I need to right click to close it.

Debug_zps2c65c394.jpg
 
AudioSwitch page has instructions what functions are available - Shift + Click closes the app. But as for the error message, does it occur if you right click the icon, or when you left-click it to see the menu? What happens when you just right-click the icon, does it switch the device or not? If it does, then what happens if you right-click on the icon again? does this sequential right-clicking work without errors, does the error only happen when you left-click it after a right click, or does it happen always immediately when you right-click the icon? :)

Bwaahhh this is confusing even for me, basically - try to describe the sequences of your actions, because I surely can't see any logical errors what could cause this right now.
 
One small request to AudioSwitch users: I have seen that people are using/trying to use it also on Windows Vista. Can someone please confirm that it works properly also on Vista, or that it doesn't? It would be cool if I could change the compatibility requirement to "Starting from Windows Vista" on Google Code page :)

Thanks!!
 
AudioSwitch page has instructions what functions are available - Shift + Click closes the app. But as for the error message, does it occur if you right click the icon, or when you left-click it to see the menu? What happens when you just right-click the icon, does it switch the device or not? If it does, then what happens if you right-click on the icon again? does this sequential right-clicking work without errors, does the error only happen when you left-click it after a right click, or does it happen always immediately when you right-click the icon? :)

Bwaahhh this is confusing even for me, basically - try to describe the sequences of your actions, because I surely can't see any logical errors what could cause this right now.

Sorry to cause you grief. It is not critical, just interesting to me. I just spent a few minutes playing with it and I seem to be making it crash it two different ways. The first way is that I start the application, left click on the icon to bring up the listing, then right click on the icon before making any selection. This will cause a crash with the below details. It is important for me to note that this only occurs when the first device in the list is already selected. If another device is already selected, then right clicking on the icon sets it back to the first device. In my case the first device is the default device so that could be it. If right clicking the icon is supposed to set it back to the default device, then if it is already on the default device, it is causing a crash.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at AudioSwitch.EndPoints.SetDefaultDevice(Int32 devID, EDataFlow renderType)
at AudioSwitch.FormSwitcher.notifyIcon1_MouseUp(Object sender, MouseEventArgs e)
at System.Windows.Forms.NotifyIcon.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.NotifyIcon.WmMouseUp(Message& m, MouseButtons button)
at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
at System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I am also able to get it to crash another way. On this laptop, any time I select Independent (R.T.C.) Headphones IDT High Definition Audio CODEC (the second one in my screenshot picture), it immediately crashes with the below error.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at AudioSwitch.EndPoints.SetDefaultDevice(Int32 devID, EDataFlow renderType)
at AudioSwitch.FormSwitcher.listView1_ItemSelectionChanged(Object sender, ListViewItemSelectionChangedEventArgs e)
at System.Windows.Forms.ListViewItemSelectionChangedEventHandler.Invoke(Object sender, ListViewItemSelectionChangedEventArgs e)
at System.Windows.Forms.ListView.OnItemSelectionChanged(ListViewItemSelectionChangedEventArgs e)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at AudioSwitch.CustomListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Hope some of that helps.
 
Hey, no grief whatsoever. It's just difficult to pinpoint the issue when I can't reproduce it myself in no way. That's why I made a debug version with some extra logging - please download it and use it the same way, to reproduce errors the same way. It might not show you these errors anymore, but instead it logs them and some other info to "debug.log" file in the same folder. If you still get some similar error messages then just send the text also to me. When you are done and think the log has enough bad stuff in there then please send it to me to tanel(.-.at.-.)submain.eu for evaluation. You can find the debug version here:
http://submain.eu/AudioSwitch-Debug.zip

Thanks for your extensive testing and patience!! :)
 
Last edited:
Yes, it works perfectly in Windows 8 - in fact, I'm developing it on Windows 8 Pro x64 ;)
 
new version is out, additionally to some bugfixes it now supports also command-line options! Go get it :)
 
sirWest and bdr529, this tool is amazing, thank you very much!
 
The latest version still crashes for me. Is it ok that I keep using the debug versions as that one doesn't crash and just writes to the debug log?
 
Neat. I made a (much rougher) app that did the same thing. It basically scripted all of those key presses to a global hotkey, so I would just do a key combo like "CTRL+ALT+SHIFT+3" and it would switch from my headphones to my speakers, and vice versa. Yours does this, and works a lot better too; puts my app to shame.

Thanks!
 
The latest version still crashes for me. Is it ok that I keep using the debug versions as that one doesn't crash and just writes to the debug log?

ahh I just released an update and now remembered this issue again :) I think it's ok to use the debug version but it creates this log file which might grow quite big. I'll put an extended exe-only (no code update) which is for these special cases like yours, which would just ignore this error and not do anything in this case. Be warned that this basically disables functionality on these devices where it has issues, so it's not a recommended version for others. I didn't find any solution for this since it's coming from Windows' own interface calls and since it's an undocumented API then probably no MS expert will help us with this. So the only thing really to do is ignore this error if it appears.

@Cool1Net6: Yours is definitely straight-forward and for a solid purpose, as mine has just more eye-candy and some other features that already exist in the default volume control. The main reason I started doing it was my father who uses only mouse, or as much as possible, and doesn't want to mess with any keyboard shortcuts :) That's why most stuff is possible to do with mouse clicks ;)
 
Back
Top