fix: MP3 would not play if buffer size < 1152

This commit is contained in:
minjaesong
2023-12-11 16:50:58 +09:00
parent 96c9aed25a
commit 82e89452d6
2 changed files with 37 additions and 21 deletions

View File

@@ -454,7 +454,7 @@ class BasicDebugInfoWindow : UICanvas() {
private val oldRMS = Array(trackCount) { arrayOf(0.0, 0.0) }
private val oldComp = Array(trackCount) { arrayOf(0.0, 0.0) }
private fun getSmoothingFactor(sampleCount: Int) = 1.0 - (AUDIO_BUFFER_SIZE / sampleCount)
private fun getSmoothingFactor(sampleCount: Int) = 1.0 - (AUDIO_BUFFER_SIZE.toDouble() / sampleCount)
private val PEAK_SMOOTHING_FACTOR = getSmoothingFactor(640)
private val LAMP_SMOOTHING_FACTOR = getSmoothingFactor(3200)
private val RMS_SMOOTHING_FACTOR = getSmoothingFactor(12000)