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

View File

@@ -19,7 +19,7 @@ class TerrarumAudioMixerTrack(val name: String, val isMaster: Boolean = false):
const val SAMPLING_RATE = 48000
const val SAMPLING_RATEF = 48000f
const val SAMPLING_RATED = 48000.0
const val BUFFER_SIZE = 12000
const val BUFFER_SIZE = 6000
const val INDEX_BGM = 0
const val INDEX_AMB = 1