Skip to content

Commit

Permalink
fix(AudioSwitcher): Switching audio for Windows 10 < 1803
Browse files Browse the repository at this point in the history
Fixes SOUNDSWITCH-EJ
Fixes SOUNDSWITCH-EH
  • Loading branch information
Belphemur committed Nov 3, 2021
1 parent 5c5c0cd commit e30e23e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace SoundSwitch.Audio.Manager.Interop.Client.Extended.Factory
internal static class AudioPolicyConfigFactory
{
private const int OS_21H2_VERSION = 21390;
private const int OS_1709_VERSION = 16299;

public static IAudioPolicyConfig Create()
{
Expand All @@ -17,12 +18,12 @@ public static IAudioPolicyConfig Create()
return new UnsupportedAudioPolicyConfig();
}

if (Environment.OSVersion.Version.Build >= OS_21H2_VERSION)
return Environment.OSVersion.Version.Build switch
{
return new Post21H2AudioPolicyConfig();
}

return new Pre21H2AudioPolicyConfig();
<= OS_1709_VERSION => new UnsupportedAudioPolicyConfig(),
>= OS_21H2_VERSION => new Post21H2AudioPolicyConfig(),
_ => new Pre21H2AudioPolicyConfig()
};
});
}
}
Expand Down

0 comments on commit e30e23e

Please sign in to comment.