From 18874202445c7549b3f122fbf120b3ebd1a4f026 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 18 May 2019 15:51:37 +1000 Subject: [PATCH] Refactor CurrentOS usage in Sound --- BizHawk.Client.EmuHawk/Sound/Sound.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/Sound/Sound.cs b/BizHawk.Client.EmuHawk/Sound/Sound.cs index 6461747c50..85aaa2502d 100644 --- a/BizHawk.Client.EmuHawk/Sound/Sound.cs +++ b/BizHawk.Client.EmuHawk/Sound/Sound.cs @@ -25,15 +25,17 @@ namespace BizHawk.Client.EmuHawk public Sound(IntPtr mainWindowHandle) { - if (Global.Config.SoundOutputMethod == Config.ESoundOutputMethod.OpenAL) - _outputDevice = new OpenALSoundOutput(this); if (OSTailoredCode.CurrentOS == OSTailoredCode.DistinctOS.Windows) { + if (Global.Config.SoundOutputMethod == Config.ESoundOutputMethod.OpenAL) + _outputDevice = new OpenALSoundOutput(this); if (Global.Config.SoundOutputMethod == Config.ESoundOutputMethod.DirectSound) _outputDevice = new DirectSoundSoundOutput(this, mainWindowHandle); if (Global.Config.SoundOutputMethod == Config.ESoundOutputMethod.XAudio2) _outputDevice = new XAudio2SoundOutput(this); } + else _outputDevice = new OpenALSoundOutput(this); // at the moment unix/mono can only support OpenAL (so ignore whatever is set in the config) + if (_outputDevice == null) _outputDevice = new DummySoundOutput(this); }