mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
buffer size adjustments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user