Skip to content

Commit e30e23e

Browse files
committed
fix(AudioSwitcher): Switching audio for Windows 10 < 1803
Fixes SOUNDSWITCH-EJ Fixes SOUNDSWITCH-EH
1 parent 5c5c0cd commit e30e23e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

SoundSwitch.Audio.Manager/Interop/Client/Extended/Factory/AudioPolicyConfigFactory.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace SoundSwitch.Audio.Manager.Interop.Client.Extended.Factory
77
internal static class AudioPolicyConfigFactory
88
{
99
private const int OS_21H2_VERSION = 21390;
10+
private const int OS_1709_VERSION = 16299;
1011

1112
public static IAudioPolicyConfig Create()
1213
{
@@ -17,12 +18,12 @@ public static IAudioPolicyConfig Create()
1718
return new UnsupportedAudioPolicyConfig();
1819
}
1920

20-
if (Environment.OSVersion.Version.Build >= OS_21H2_VERSION)
21+
return Environment.OSVersion.Version.Build switch
2122
{
22-
return new Post21H2AudioPolicyConfig();
23-
}
24-
25-
return new Pre21H2AudioPolicyConfig();
23+
<= OS_1709_VERSION => new UnsupportedAudioPolicyConfig(),
24+
>= OS_21H2_VERSION => new Post21H2AudioPolicyConfig(),
25+
_ => new Pre21H2AudioPolicyConfig()
26+
};
2627
});
2728
}
2829
}

0 commit comments

Comments
 (0)