mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
sequentially-read-a-file as js module
This commit is contained in:
@@ -38,11 +38,15 @@ private class RenderRunnable(val playhead: AudioAdapter.Playhead) : Runnable {
|
||||
|
||||
// printdbg("P${playhead.index+1} go back to spinning")
|
||||
|
||||
Thread.sleep(2)
|
||||
Thread.sleep(12)
|
||||
}
|
||||
else if (playhead.isPlaying && writeQueue.isEmpty) {
|
||||
printdbg("Queue exhausted, stopping audio device...")
|
||||
playhead.audioDevice.stop()
|
||||
|
||||
// TODO: wait for 1-2 seconds then finally stop the device
|
||||
// playhead.audioDevice.stop()
|
||||
|
||||
Thread.sleep(12)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +81,10 @@ private class WriteQueueingRunnable(val playhead: AudioAdapter.Playhead, val pcm
|
||||
it.position += 1
|
||||
Thread.sleep(6)
|
||||
}
|
||||
else if (it.pcmUpload) {
|
||||
printdbg("Rejecting samples (queueSize: ${it.pcmQueue.size}, uploadLength: ${it.pcmUploadLength})")
|
||||
Thread.sleep(6)
|
||||
}
|
||||
}
|
||||
|
||||
Thread.sleep(1)
|
||||
@@ -394,7 +402,7 @@ class AudioAdapter(val vm: VM) : PeriBase {
|
||||
}
|
||||
}
|
||||
|
||||
fun getPcmQueueCapacity() = QUEUE_SIZE[pcmQueueSizeIndex]
|
||||
fun getPcmQueueCapacity() = 2147483647//QUEUE_SIZE[pcmQueueSizeIndex]
|
||||
|
||||
fun dispose() {
|
||||
println("AudioDevice dispose ${parent.renderThreads[index]}")
|
||||
|
||||
Reference in New Issue
Block a user