From 40f5ba119a41d04b8057e75146345c84dfe238c3 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Sun, 24 Oct 2021 10:30:45 -0400 Subject: [PATCH] fix(AudioSwitching): Fix audio switching on Windows 11 Fixes #799 Fixes SOUNDSWITCH-D3 --- .../Interop/Interface/Policy/Extended/IAudioPolicyConfig.cs | 4 ++-- .../Policy/Extended/IAudioPolicyConfigFactoryNative.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfig.cs b/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfig.cs index 8b7de99a13..307616a34b 100644 --- a/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfig.cs +++ b/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfig.cs @@ -6,7 +6,7 @@ namespace SoundSwitch.Audio.Manager.Interop.Interface.Policy.Extended; public interface IAudioPolicyConfig { /// - /// Set the audio enpoint for this device + /// Set the audio endpoint for the process /// /// /// @@ -15,7 +15,7 @@ public interface IAudioPolicyConfig void SetPersistedDefaultAudioEndpoint(uint processId, EDataFlow flow, ERole role, string deviceId); /// - /// Get Audio enpoint of the device + /// Get Audio endpoint of the process /// /// /// diff --git a/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfigFactoryNative.cs b/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfigFactoryNative.cs index 74f8fe860f..ebe49efa1f 100644 --- a/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfigFactoryNative.cs +++ b/SoundSwitch.Audio.Manager/Interop/Interface/Policy/Extended/IAudioPolicyConfigFactoryNative.cs @@ -5,7 +5,6 @@ namespace SoundSwitch.Audio.Manager.Interop.Interface.Policy.Extended { - [Guid("ab3d4648-e242-459f-b02f-541c70306324")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] @@ -32,10 +31,10 @@ public interface IAudioPolicyConfigFactoryVariant21H2Windows11 int __incomplete__remove_ChatContextChanged(); [PreserveSig] - HRESULT SetPersistedDefaultAudioEndpoint(uint processId, EDataFlow flow, ERole role, HSTRING deviceId); + HRESULT SetPersistedDefaultAudioEndpoint([In] uint processId, [In] EDataFlow flow, [In] ERole role, [In] HSTRING deviceId); [PreserveSig] - HRESULT GetPersistedDefaultAudioEndpoint(uint processId, EDataFlow flow, ERole role, [Out, MarshalAs(UnmanagedType.HString)] out HSTRING deviceId); + HRESULT GetPersistedDefaultAudioEndpoint([In] uint processId, [In] EDataFlow flow, [In] ERole role, [Out] out HSTRING deviceId); [PreserveSig] HRESULT ClearAllPersistedApplicationDefaultEndpoints();