mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 22:14:05 +09:00
music playlist is working again
This commit is contained in:
@@ -34,6 +34,28 @@ class AudioProcessBuf(val size: Int) {
|
||||
updateFloats()
|
||||
}
|
||||
|
||||
// reusing a buffer causes tons of blips in the sound? how??
|
||||
/*private val L0buf = FloatArray(size / 4)
|
||||
private val R0buf = FloatArray(size / 4)
|
||||
private val L1buf = FloatArray(size / 4)
|
||||
private val R1buf = FloatArray(size / 4)
|
||||
|
||||
fun getL0(volume: Double): FloatArray {
|
||||
for (i in L0buf.indices) { L0buf[i] = (volume * fbuf0[2*i]).toFloat() }
|
||||
return L0buf
|
||||
}
|
||||
fun getR0(volume: Double): FloatArray {
|
||||
for (i in R0buf.indices) { R0buf[i] = (volume * fbuf0[2*i+1]).toFloat() }
|
||||
return R0buf
|
||||
}
|
||||
fun getL1(volume: Double): FloatArray {
|
||||
for (i in L1buf.indices) { L1buf[i] = (volume * fbuf1[2*i]).toFloat() }
|
||||
return L1buf
|
||||
}
|
||||
fun getR1(volume: Double): FloatArray {
|
||||
for (i in R1buf.indices) { R1buf[i] = (volume * fbuf1[2*i+1]).toFloat() }
|
||||
return R1buf
|
||||
}*/
|
||||
fun getL0(volume: Double) = FloatArray(size / 4) { (volume * fbuf0[2*it]).toFloat() }
|
||||
fun getR0(volume: Double) = FloatArray(size / 4) { (volume * fbuf0[2*it+1]).toFloat() }
|
||||
fun getL1(volume: Double) = FloatArray(size / 4) { (volume * fbuf1[2*it]).toFloat() }
|
||||
|
||||
Reference in New Issue
Block a user