mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-20 15:34:05 +09:00
more audio codes
This commit is contained in:
@@ -14,6 +14,9 @@ import java.io.File
|
||||
*/
|
||||
object AudioHelper {
|
||||
|
||||
/**
|
||||
* The audio must be in stereo (two channels)
|
||||
*/
|
||||
fun getIR(module: String, path: String): Array<ComplexArray> {
|
||||
val id = "convolution$$module.$path"
|
||||
|
||||
@@ -66,6 +69,9 @@ object AudioHelper {
|
||||
return Array(2) { FFT.fft(conv[it]) }
|
||||
}
|
||||
|
||||
/**
|
||||
* The audio must be in stereo
|
||||
*/
|
||||
fun getAudioInSamples(module: String, path: String): Array<FloatArray> {
|
||||
val id = "audiosamplesf32$$module.$path"
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package net.torvald.terrarum.audio.audiobank
|
||||
|
||||
import com.badlogic.gdx.utils.Queue
|
||||
import net.torvald.terrarum.INGAME
|
||||
import net.torvald.terrarum.audio.AudioBank
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-04-12.
|
||||
*/
|
||||
class AudioBankMusicBox(override var songFinishedHook: (AudioBank) -> Unit = {}) : AudioBank() {
|
||||
|
||||
override val name = "spieluhr"
|
||||
override val samplingRate = 48000
|
||||
override val channels = 1
|
||||
|
||||
override val totalSizeInSamples = Long.MAX_VALUE // TODO length of lowest-pitch note
|
||||
|
||||
private val messageQueue = Queue<Pair<Long, Long>>() // pair of: absolute tick count, notes (61 notes polyphony)
|
||||
|
||||
override fun currentPositionInSamples(): Long {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun readSamples(bufferL: FloatArray, bufferR: FloatArray): Int {
|
||||
val tickCount = INGAME.WORLD_UPDATE_TIMER
|
||||
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun reset() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun makeCopy(): AudioBank {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user