From a227de2875f4eb0acb84fd8fece12d9e1f97b558 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Mon, 8 Jan 2024 22:52:31 -0500 Subject: [PATCH] (hopefully) fix controllers not being initialized with certain settings --- Assets/Scripts/GlobalGameManager.cs | 1 - Assets/Scripts/InputSystem/PlayerInput.cs | 1 - Assets/Scripts/Util/SavWav.cs | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/GlobalGameManager.cs b/Assets/Scripts/GlobalGameManager.cs index 85ebaee0..ddded770 100644 --- a/Assets/Scripts/GlobalGameManager.cs +++ b/Assets/Scripts/GlobalGameManager.cs @@ -108,7 +108,6 @@ namespace HeavenStudio // ChangeAudioSettings(currentDspSize, currentSampleRate); AudioConfiguration config = AudioSettings.GetConfiguration(); - if (currentDspSize == config.dspBufferSize && currentSampleRate == config.sampleRate) return; config.dspBufferSize = currentDspSize; config.sampleRate = currentSampleRate; AudioSettings.Reset(config); diff --git a/Assets/Scripts/InputSystem/PlayerInput.cs b/Assets/Scripts/InputSystem/PlayerInput.cs index 4c4cc471..f8668236 100644 --- a/Assets/Scripts/InputSystem/PlayerInput.cs +++ b/Assets/Scripts/InputSystem/PlayerInput.cs @@ -158,7 +158,6 @@ namespace HeavenStudio foreach (InputController i in inputDevices) { if (i == null) continue; - Debug.Log($"Polling controller {i.GetDeviceName()} (frame {Time.frameCount})"); i.UpdateState(); } } diff --git a/Assets/Scripts/Util/SavWav.cs b/Assets/Scripts/Util/SavWav.cs index 3ea7d8e1..e3167257 100644 --- a/Assets/Scripts/Util/SavWav.cs +++ b/Assets/Scripts/Util/SavWav.cs @@ -67,6 +67,8 @@ public static class SavWav { var wav = GetWav(clip, out var length, trim); writer.Write(wav, 0, (int)length); + fileStream.Close(); + fileStream.Dispose(); } }