mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
fix: continuous album now plays again
This commit is contained in:
@@ -250,7 +250,7 @@ class AudioMixer : Disposable {
|
||||
// initialise audio paths //
|
||||
|
||||
listOf(musicTrack, ambientTrack1, ambientTrack2, ambientTrack3, ambientTrack4, guiTrack).forEach {
|
||||
it.filters[0] = Gain(1f)
|
||||
it.filters[0] = PreGain(1f)
|
||||
}
|
||||
|
||||
guiTracks.forEach {
|
||||
@@ -285,11 +285,11 @@ class AudioMixer : Disposable {
|
||||
}
|
||||
|
||||
convolveBusOpen.filters[1] = Convolv("basegame", "audio/convolution/EchoThief - PurgatoryChasm.bin", decibelsToFullscale(-6.0).toFloat())
|
||||
convolveBusOpen.filters[2] = Gain(decibelsToFullscale(17.0).toFloat()) // don't make it too loud; it'll sound like a shit
|
||||
convolveBusOpen.filters[2] = PreGain(decibelsToFullscale(17.0).toFloat()) // don't make it too loud; it'll sound like a shit
|
||||
convolveBusOpen.volume = 0.5 // will be controlled by the other updater which surveys the world
|
||||
|
||||
convolveBusCave.filters[1] = Convolv("basegame", "audio/convolution/EchoThief - WaterplacePark-trimmed.bin", decibelsToFullscale(-3.0).toFloat())
|
||||
convolveBusCave.filters[2] = Gain(decibelsToFullscale(16.0).toFloat())
|
||||
convolveBusCave.filters[2] = PreGain(decibelsToFullscale(16.0).toFloat())
|
||||
convolveBusCave.volume = 0.5 // will be controlled by the other updater which surveys the world
|
||||
|
||||
fadeBus.addSidechainInput(sumBus, 1.0 / 3.0)
|
||||
@@ -392,12 +392,12 @@ class AudioMixer : Disposable {
|
||||
// the real updates
|
||||
(Gdx.audio as? Lwjgl3Audio)?.update()
|
||||
masterTrack.volume = masterVolume
|
||||
musicTrack.getFilter<Gain>().gain = musicVolume.toFloat() * 0.5f
|
||||
musicTrack.getFilter<PreGain>().gain = musicVolume.toFloat() * 0.5f
|
||||
ambientTracks.forEach {
|
||||
it.getFilter<Gain>().gain = ambientVolume.toFloat()
|
||||
it.getFilter<PreGain>().gain = ambientVolume.toFloat()
|
||||
}
|
||||
sfxSumBus.volume = sfxVolume
|
||||
guiTrack.getFilter<Gain>().gain = guiVolume.toFloat()
|
||||
guiTrack.getFilter<PreGain>().gain = guiVolume.toFloat()
|
||||
|
||||
|
||||
// process fades
|
||||
|
||||
@@ -9,7 +9,7 @@ import kotlin.math.roundToInt
|
||||
/**
|
||||
* Created by minjaesong on 2023-11-25.
|
||||
*/
|
||||
class Gain(var gain: Float): TerrarumAudioFilter() {
|
||||
class PreGain(var gain: Float): TerrarumAudioFilter() {
|
||||
override fun thru(inbuf: List<FloatArray>, outbuf: List<FloatArray>) {
|
||||
for (i in 0 until App.audioBufferSize) {
|
||||
outbuf[0][i] = inbuf[0][i] * gain
|
||||
@@ -25,7 +25,7 @@ class Gain(var gain: Float): TerrarumAudioFilter() {
|
||||
override val debugViewHeight = 16
|
||||
|
||||
override fun copyParamsFrom(other: TerrarumAudioFilter) {
|
||||
if (other is Gain) {
|
||||
if (other is PreGain) {
|
||||
this.gain = other.gain
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user