From b57b1966a7712617a203e122d95c22b550543f19 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 19 Nov 2020 10:14:44 -0500 Subject: [PATCH] Switched to ALSA Soloud backend / Fixed sound muffling at start --- core/src/mindustry/audio/SoundControl.java | 9 ++++----- gradle.properties | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/audio/SoundControl.java b/core/src/mindustry/audio/SoundControl.java index 94f207a571..bed176f972 100644 --- a/core/src/mindustry/audio/SoundControl.java +++ b/core/src/mindustry/audio/SoundControl.java @@ -27,13 +27,13 @@ public class SoundControl{ public Seq bossMusic = Seq.with(); protected Music lastRandomPlayed; - protected Interval timer = new Interval(); + protected Interval timer = new Interval(4); protected @Nullable Music current; protected float fade; protected boolean silenced; protected AudioBus uiBus = new AudioBus(); - protected boolean wasPaused, wasPlaying; + protected boolean wasPlaying; protected AudioFilter filter = new BiquadFilter(){{ set(0, 500, 1); }}; @@ -117,9 +117,8 @@ public class SoundControl{ fade = 0f; } - //fade the lowpass filter in/out - if(paused != wasPaused){ - wasPaused = paused; + //fade the lowpass filter in/out, poll every 30 ticks just in case performance is an issue + if(timer.get(1, 30f)){ Core.audio.soundBus.fadeFilterParam(0, Filters.paramWet, paused ? 1f : 0f, 0.4f); } diff --git a/gradle.properties b/gradle.properties index 2f07857d64..29ecfb9b75 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=90dcc6533cc38b415a18202963e35d9c16587c2a +archash=e327ec0bf805e7ad3cb4d95b242bf8424c487a64