buffer size adjustments

This commit is contained in:
minjaesong
2023-11-19 14:11:19 +09:00
parent 574c2e6745
commit d77b8087cb
3 changed files with 19 additions and 5 deletions

View File

@@ -12,8 +12,9 @@ import kotlin.math.absoluteValue
*/
class MixerTrackProcessor(val bufferSize: Int, val rate: Int, val track: TerrarumAudioMixerTrack): Runnable {
val BACK_BUF_COUNT = 2
companion object {
val BACK_BUF_COUNT = 1
}
@Volatile private var running = true
@Volatile private var paused = false
@@ -163,6 +164,9 @@ class MixerTrackProcessor(val bufferSize: Int, val rate: Int, val track: Terraru
maxSigLevel[index] = fl.toDouble()
}
}
else {
maxSigLevel.fill(0.0)
}
// by this time, the output buffer is filled with processed results, pause the execution