sound engine is no longer a singleton

This commit is contained in:
minjaesong
2024-01-16 02:50:47 +09:00
parent 350e205028
commit 755ced9ea4
30 changed files with 275 additions and 159 deletions

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.audio.dsp
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.jme3.math.FastMath
import net.torvald.terrarum.App
import net.torvald.terrarum.audio.TerrarumAudioMixerTrack
import kotlin.math.roundToInt
@@ -31,7 +32,7 @@ class Reverb(val delayMS: Float = 36f, var feedback: Float = 0.92f, var lowpass:
val alphaHi = RCHi / (RCHi + dt)
for (ch in outbuf.indices) {
for (i in 0 until TerrarumAudioMixerTrack.AUDIO_BUFFER_SIZE) {
for (i in 0 until App.audioBufferSize) {
val inn = inbuf[ch][i]
// reverb
@@ -52,4 +53,8 @@ class Reverb(val delayMS: Float = 36f, var feedback: Float = 0.92f, var lowpass:
}
override val debugViewHeight = 0
override fun reset() {
buf.forEach { it.fill(0f) }
}
}