wtf is going on

This commit is contained in:
minjaesong
2024-01-11 13:31:17 +09:00
parent d92fae4bb1
commit ecd8f08419
2 changed files with 2 additions and 1 deletions

View File

@@ -111,6 +111,7 @@ class MixerTrackProcessor(val buffertaille: Int, val rate: Int, val track: Terra
(track.filters[0] as BinoPan).pan = 0f
}
else if (track.trackingTarget is ActorWithBody) {
// FIXME this may cause filter to fill the output buffer with NaNs?
val relativeXpos = relativeXposition(AudioMixer.actorNowPlaying!!, track.trackingTarget as ActorWithBody)
track.volume = track.maxVolume * (1.0 - relativeXpos.absoluteValue.pow(0.5) / distFalloff)
(track.filters[0] as BinoPan).pan = ((2*asin(relativeXpos / distFalloff)) / Math.PI).toFloat()

View File

@@ -469,7 +469,7 @@ class BasicDebugInfoWindow : UICanvas() {
private val dbLow = 60.0
private val oldPeak = Array(trackCount) { arrayOf(0.0, 0.0) }
private val oldPeakDS = Array(256) { arrayOf(0.0, 0.0) }
private val oldPeakDS = Array(App.getConfigInt("audio_dynamic_source_max")) { arrayOf(0.0, 0.0) }
private val oldRMS = Array(trackCount) { arrayOf(0.0, 0.0) }
private val oldComp = Array(trackCount) { arrayOf(0.0, 0.0) }