mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
adjustable audio buffer size via config
This commit is contained in:
@@ -117,6 +117,7 @@ object AudioMixer: Disposable {
|
||||
val callables = tracks.map { Callable {
|
||||
if (!it.processor.paused) {
|
||||
try { it.processor.run() }
|
||||
catch (_: InterruptedException) {}
|
||||
catch (e: Throwable) { e.printStackTrace() }
|
||||
}
|
||||
} }
|
||||
@@ -126,7 +127,8 @@ object AudioMixer: Disposable {
|
||||
processingExecutor.submitAll(callables)
|
||||
processingExecutor.join()
|
||||
}
|
||||
catch (_: Throwable) {}
|
||||
catch (_: InterruptedException) {}
|
||||
catch (e: Throwable) { e.printStackTrace() }
|
||||
|
||||
|
||||
/*processingSubthreads = tracks.map { Thread {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.backends.lwjgl3.audio.OpenALLwjgl3Audio
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
import com.badlogic.gdx.utils.Queue
|
||||
import net.torvald.reflection.forceInvoke
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.getHashStr
|
||||
import net.torvald.terrarum.hashStrMap
|
||||
import net.torvald.terrarum.modulebasegame.MusicContainer
|
||||
@@ -20,7 +21,7 @@ class TerrarumAudioMixerTrack(val name: String, val isMaster: Boolean = false, v
|
||||
const val SAMPLING_RATE = 48000
|
||||
const val SAMPLING_RATEF = 48000f
|
||||
const val SAMPLING_RATED = 48000.0
|
||||
const val BUFFER_SIZE = 256*4 // n ms -> 384 * n
|
||||
val BUFFER_SIZE = 4 * App.getConfigInt("audiobuffersize") // n ms -> 384 * n
|
||||
}
|
||||
|
||||
val hash = getHashStr()
|
||||
|
||||
Reference in New Issue
Block a user