davkean / audio-switcher Goto Github PK
View Code? Open in Web Editor NEWApp that lets you easily switch Windows audio devices
License: MIT License
App that lets you easily switch Windows audio devices
License: MIT License
Certain notebooks, in particular the one @terrajobst has, does not automatically switch to the speakers when he up unplugs his headphones. This is probably because it's always seen as "Active" regardless of whether the headphones are connected.
Probably need to look at the jack state change of the individual audio devices and respect that.
Application crashes when there id no sound card in the system. This may happen before I power on my external card or get my headphone out and pljug them in.
Currently, on install we just silently install, this combined with AudioSwitcher heading into the overflow window for the notification area, doesn't make it very obvious that something happened.
I was looking through the code when I noriced that LoadLibraryEx was PInvoked. Ok, what dark magic requires this? Loading all the icons that get embedded into the DLL apparently.
It seems like a lot of low level code to load some icons. This can be done in a completely managed fashion. Is there any reason you preferred this unmanaged method?
When you have dual monitors and the notification icon is on the very right of the notification area, the device menu can appear on the wrong screen.
The device context menu updates for existing device changes, such as state changes, properties (name, icon), and default device - however, new and removed devices are not reflected.
Repro:
Looks like we probably need at least a 32x32 version of the icon that @Ianvdl made.
I see in the settings under General Behavior there is a Default GUI Devices option. Is it however possible to toggle between Playback devices and Recording devices whether with a click handle or keyboard shortcut when the GUI is visible?
The screenshot in the README displays both device types being shown on the same view. I see only Playback devices.
The app shows the following exception window when entering an RDP session.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Specified cast is not valid.
at AudioSwitcher.Audio.AudioDeviceManager.SetDefaultAudioDevice(AudioDevice device, AudioDeviceRole role) in C:\Repos\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 78
at AudioSwitcher.Audio.AudioDeviceManager.SetDefaultAudioDevice(AudioDevice device) in C:\Repos\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 71
at AudioSwitcher.Audio.InputSwitcherService.OnDeviceStateChanged(Object sender, AudioDeviceStateEventArgs e) in C:\Repos\audio-switcher\src\AudioSwitcher\Audio\InputSwitcherService.cs:line 41
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass24_0.<AudioSwitcher.Audio.Interop.IMMNotificationClient.OnDeviceStateChanged>b__0() in C:\Repos\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 154
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass30_0.<InvokeOnSynchronizationContext>b__0(Object state) in C:\Repos\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 234
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
Assembly Version: 0.1.0.0
Win32 Version: 0.1.0.0
CodeBase: file:///D:/Software/Audio%20Switcher/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_29d9e831-87e5-4634-8a27-e4f3c4b5add9
Assembly Version: 0.0.0.0
Win32 Version: 4.8.3752.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Our Corporate Symantec Virus protection system flagged the following NuGet item as a "Trojan.Gen.2" Virus:
squirrel.windows.0.8.0
Removing that, the app builds and seems to run fine. Who and why was that NuGet added? It appears that is an older version and perhaps that Nuget get path was commandeered? Or a false-positive?
I got a dialogue box with an error containing this information when I tried to switch audio devices from my USB headphones to my speakers. I tried to switch right after starting to play a song in Spotify. This also forced spotify to quit.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NotImplementedException: PropVariant VT_EMPTY
at AudioSwitcher.Audio.Interop.PropVariant.get_Value() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropVariant.cs:line 197
at AudioSwitcher.Audio.PropertyStoreProperty.get_Value() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropertyStoreProperty.cs:line 64
at AudioSwitcher.Audio.PropertyStore.TryGetValue(PropertyKey key, Object& value) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropertyStore.cs:line 142
at AudioSwitcher.Audio.AudioDevice.get_DeviceFriendlyName() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDevice.cs:line 83
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.UpdateStatus(AudioDeviceManager deviceManager) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModel.cs:line 80
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModelManager.OnDefaultDeviceChanged(Object sender, DefaultAudioDeviceEventArgs e) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModelManager.cs:line 115
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass6.<AudioSwitcher_Audio_Interop_IMMNotificationClient_OnDefaultDeviceChanged>b__7() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 187
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass10.<InvokeOnSynchronizationContext>b__11(Object state) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 223
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
Assembly Version: 0.1.0.0
Win32 Version: 0.1.0.0
CodeBase: file:///C:/Users/Travis/Projects/_3rdPartySource/audio-switcher/src/AudioSwitcher/bin/Debug/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_29a73af8-171c-43e3-8633-4c51b83b5bf3
Assembly Version: 0.0.0.0
Win32 Version: 4.6.7.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
@byteblast Thanks!
To repro:
For example, bluetooth headphones usually paired with a smartphone. To connect them to PC, you have to turn on discovery mode on the headphones. During this mode, you have to click Connect menu item in context menu in standard Playback Devices dialog, thus making audio-switcher useless...
Having this feature "Reconnect to Bluetooth Device" built-in, Playback Devices dialog will be totally forgotten ;)
Crashes when setting a new default audio device.
Exception details:
An unhandled exception of type 'System.InvalidCastException' occurred in AudioSwitcher.exe
Additional information: Unable to cast COM object of type
'AudioSwitcher.Audio.Interop.PolicyConfig' to interface type
'AudioSwitcher.Audio.Interop.IPolicyConfig'. This operation failed
because the QueryInterface call on the COM component for the
interface with IID '{F8679F50-850A-41CF-9C72-430F290290C8}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Crash is in
AudioDeviceManager.SetDefaultAudioDevice Line 85 - called with one of my audio devices & AudioDeviceRole.Multimedia
.
This is on Win10 Build 10041.
Let me know if there's anything I can do to investigate!
When viewing the properties of a recording device, under the "Listen" tab you can "Listen to this device" through a designated playback device.
The ability to change this playback device quickly/hotkeys/programmatically would be a very nice feature.
For my usage pattern it would be ideal if this app supported play/record device combos.
I almost always switch between my headset (mic/speaker) and my PC speaker with my Rode Podcaster mic on my desktop, or between my headset (mic/speaker) and my PC speaker/mic on my Surface.
I almost never switch only the playback or the record device - can't remember the last time I did such a thing actually.
So having Audio Switcher support play/record device pairs as a single option would be really ideal.
Might be because i plugged in an external mic and speaker before resuming
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at AudioSwitcher.Audio.AudioDeviceManager.GetDefaultAudioDevice(AudioDeviceKind kind, AudioDeviceRole role) in c:\Code\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 124
at AudioSwitcher.Audio.AudioDeviceManager.IsDefaultAudioDevice(AudioDevice device, AudioDeviceRole role) in c:\Code\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 107
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.CalculateDeviceDefaultState(AudioDeviceManager deviceManager) in c:\Code\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModel.cs:line 254
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.UpdateStatus(AudioDeviceManager deviceManager) in c:\Code\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModel.cs:line 79
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModelManager.OnDeviceStateChanged(Object sender, AudioDeviceStateEventArgs e) in c:\Code\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModelManager.cs:line 99
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass1.<AudioSwitcher.Audio.Interop.IMMNotificationClient.OnDeviceStateChanged>b__0() in c:\Code\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 154
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass11.<InvokeOnSynchronizationContext>b__f(Object state) in c:\Code\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 234
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
Assembly Version: 0.1.0.0
Win32 Version: 0.1.0.0
CodeBase: file:///C:/Code/audio-switcher/src/AudioSwitcher/bin/Debug/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.57.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_c6889f80-f9ce-42c8-9425-72cf6f9abeef
Assembly Version: 0.0.0.0
Win32 Version: 4.6.57.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NotImplementedException: PropVariant VT_EMPTY
at AudioSwitcher.Audio.Interop.PropVariant.get_Value()
at AudioSwitcher.Audio.PropertyStore.TryGetValue(PropertyKey key, Object& value)
at AudioSwitcher.Audio.AudioDevice.get_DeviceFriendlyName()
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.UpdateStatus(AudioDeviceManager deviceManager)
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModelManager.OnDefaultDeviceChanged(Object sender, DefaultAudioDeviceEventArgs e)
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClassa.<AudioSwitcher.Audio.Interop.IMMNotificationClient.OnDefaultDeviceChanged>b__9()
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass11.<InvokeOnSynchronizationContext>b__f(Object state)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34014 built by: FX45W81RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
Assembly Version: 0.1.0.0
Win32 Version: 0.1.0.0
CodeBase: file:///C:/Users/Paul/AppData/Local/AudioSwitcher/app-0.1.0.0/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_f3d4308d-b709-40bc-8042-53249ce2c4d7
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.33440
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
It would be useful to add a build script to the project so that someone without Visual Studio but with the .Net Framework SDK could build and package the project.
This would also make it easier to run on a CI platform so you could produce automatic builds on every commit.
It would be straightforward to build something out in Cake to achieve this; and I would be open to creating a pull request for this if it would fit in with your project.
Sound control panel seems to order on FriendlyName ("High Definition Audio Device") then something else. We currently order on just the order that the MMAudio APIs return. We should return the same order.
Same as before - crashes when setting a new default audio device. Let me know if there's anything else I can provide.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type 'AudioSwitcher.Audio.Interop.PolicyConfig' to interface type 'AudioSwitcher.Audio.Interop.IPolicyConfig3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8F9FB2AA-1C0B-4D54-B6BB-B2F2A10CE03C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at AudioSwitcher.Audio.AudioDeviceManager.SetDefaultAudioDevice(AudioDevice device, AudioDeviceRole role) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 95
at AudioSwitcher.Audio.AudioDeviceManager.SetDefaultAudioDevice(AudioDevice device) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 71
at AudioSwitcher.UI.Commands.AudioDeviceCommand.Run(AudioDeviceViewModel argument) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\UI\Commands\AudioDeviceCommand.cs:line 28
at AudioSwitcher.Presentation.CommandModel.Command`1.AudioSwitcher.Presentation.CommandModel.ICommand.Run(Object argument) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\Presentation\CommandModel\CommandOfT.cs:line 44
at AudioSwitcher.Presentation.UI.ToolStripItemCommandBinding.OnItemClicked(Object sender, ToolStripItemClickedEventArgs e) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\Presentation\UI\ToolStripItemCommandBinding.cs:line 85
at System.Windows.Forms.ToolStripItemClickedEventHandler.Invoke(Object sender, ToolStripItemClickedEventArgs e)
at System.Windows.Forms.ToolStrip.OnItemClicked(ToolStripItemClickedEventArgs e)
at System.Windows.Forms.ToolStripDropDown.OnItemClicked(ToolStripItemClickedEventArgs e)
at AudioSwitcher.Presentation.UI.AudioContextMenuStrip.OnItemClicked(ToolStripItemClickedEventArgs e) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\Presentation\UI\AudioContextMenuStrip.cs:line 72
at AudioSwitcher.Presentation.UI.Views.DeviceFlyoutView.OnItemClicked(ToolStripItemClickedEventArgs e) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\UI\Views\DeviceFlyoutView.cs:line 54
at System.Windows.Forms.ToolStrip.HandleItemClick(ToolStripItem dismissingItem)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at AudioSwitcher.Presentation.UI.Views.DeviceFlyoutView.OnMouseUp(MouseEventArgs e) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\UI\Views\DeviceFlyoutView.cs:line 43
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at AudioSwitcher.Presentation.UI.Views.DeviceFlyoutView.WndProc(Message& m) in c:\Users\George\Documents\GitHub\audio-switcher\src\AudioSwitcher\UI\Views\DeviceFlyoutView.cs:line 82
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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
Assembly Version: 0.1.0.0
Win32 Version: 0.1.0.0
CodeBase: file:///C:/Users/George/Documents/GitHub/audio-switcher/src/AudioSwitcher/bin/Debug/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_959aa4f6-7bca-45df-b99c-f82502f033ee
Assembly Version: 0.0.0.0
Win32 Version: 4.6.73.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.6.73.0 built by: NETFXREL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Maybe named pipes communication and send command-line to existing instance?
I'm using Win 10 build 10525 and getting crashes when I try switching device. Same spot as before, could you please let me know what the new Guid is or better, tell me how to find out myself? It seems insider builds frequently break this.
Device icons are hardcoded at 48x48 - they should be updated to respect Windows settings, perhaps by scaling SM_CXICON x 150% as there doesn't seem to be an associated for sizes larger than 32x32 (@96dpi).
I can open separate issues for these, but I think the "should we" needs to be discussed together.
It would be cool to have some powershell methods for switching the audio device from the CLI, for those of us into that kind of thing. Two that come to mind are of course Get-AudioDevice [-Active] [-Filter]
and Set-AudioDevice [-Name]
To do that you need a DLL, not an exe. Rather than make a DLL and a wrapper EXE, it would be simpler to replace the static void Main()
call with a call that rundll32.exe can make via UnmanagedExports The chocolatey package can then include a batch file to start this up manually, and add that batch file to the start menu.
Also, once this is a DLL, it makes sense to make this a regular nuget package and supporting an API as well.
Reinstalled the desktop camera drivers on my machine and audio switcher crashed with the following:
System.NotImplementedException: PropVariant VT_EMPTY
at AudioSwitcher.Audio.Interop.PropVariant.get_Value()
at AudioSwitcher.Audio.PropertyStoreProperty.get_Value()
at AudioSwitcher.Audio.PropertyStore.TryGetValue(PropertyKey key, Object& value)
at AudioSwitcher.Audio.AudioDevice.get_DeviceFriendlyName()
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.UpdateStatus(AudioDeviceManager deviceManager)
at AudioSwitcher.UI.ViewModels.AudioDeviceViewModelManager.OnDefaultDeviceChanged(Object sender, DefaultAudioDeviceEventArgs e)
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClassa.<AudioSwitcher.Audio.Interop.IMMNotificationClient.OnDefaultDeviceChanged>b__9()
at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass11.b__f(Object state)
Why on earth do you require people to build this on their own? This makes absolutely no sense. Please consider providing a binary in the release section which GitHub offers for this special purpose.
Would be nice if this one would be get published to chocolatey ๐
First off, sorry for posting this here as this isn't a current feature issue or a forum for feature requests, but was thinking to take the concept of AudioSwitcher to the next level. It's main purpose is to simplify the setting up of specifying the default input/output audio device. It seem that the ability to assign a Hot-Key combination to a audio device would be even more useful as the user wouldn't have to fumble with clicking and such.
Awesome app nonetheless.
Thanks for sharing.
Instead of appearing directly on top of the taskbar, audio-switcher's dialogue box appears on the second monitor, to the right of the taskbar.
Hey
I find this piece of code very appealing for the problem that is solves.
I get that there is no binary and that I gotta have build my own. I downloaded VS2013 and opened it, but it went instantly to "Trial expired" Mode. He didnt give me a single minute of using VS to build your code. After searching I found the mandatory StackOverflow Thread where people had success with using a special setTime Script (SO link, RunAsDate v1.31). I tried different Times and Years but nothing worked.
I could sign up apparently and might be able to receive a license, but that is not how OpenSource should be handled imho. Currently, I'm not able to build the projects because of the caged IDE. Do you see any way of offering a trusted binary - because I would snatch it in a heartbeat :)
Mortimer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.