Skip to content

Commit fabadd5

Browse files
committed
Move to FrameworkEnvironment
1 parent 3be315f commit fabadd5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

osu.Framework/FrameworkEnvironment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static class FrameworkEnvironment
2121
public static bool NoStructuredBuffers { get; }
2222
public static string? DeferredRendererEventsOutputPath { get; }
2323
public static bool UseSDL3 { get; }
24+
public static bool UseWasapi { get; }
2425

2526
/// <summary>
2627
/// Whether non-SSL requests should be allowed. Debug only. Defaults to disabled.
@@ -55,6 +56,8 @@ static FrameworkEnvironment()
5556

5657
// Desktop has many issues, see https://github.com/ppy/osu-framework/issues/6540.
5758
UseSDL3 = RuntimeInfo.IsMobile || (parseBool(Environment.GetEnvironmentVariable("OSU_SDL3")) ?? false);
59+
60+
UseWasapi = parseBool(Environment.GetEnvironmentVariable("OSU_AUDIO_WASAPI_EXPERIMENTAL")) ?? false;
5861
}
5962

6063
private static bool? parseBool(string? value)

osu.Framework/Threading/AudioThread.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ internal bool InitDevice(int deviceId)
140140

141141
// That this has not been mass-tested since https://github.com/ppy/osu-framework/pull/6651 and probably needs to be.
142142
// Currently envvar gated for users to test at their own discretion.
143-
bool useWasapiInit = Environment.GetEnvironmentVariable("OSU_AUDIO_WASAPI_EXPERIMENTAL") == "1";
144-
if (useWasapiInit)
143+
if (FrameworkEnvironment.UseWasapi)
145144
attemptWasapiInitialisation();
146145

147146
initialised_devices.Add(deviceId);

0 commit comments

Comments
 (0)