fix: fence voice turns and playback; add opt-in face context

This commit is contained in:
zenord
2026-10-11 20:50:11 +08:00
parent 885bb3f2db
commit 9b428fb76f
46 changed files with 2306 additions and 32 deletions
+23
View File
@@ -0,0 +1,23 @@
package com.gorios.lanvoice.audio
import com.gorios.lanvoice.net.DownlinkFrame
enum class AecAvailability { AVAILABLE, UNAVAILABLE, UNKNOWN }
// No audio devices in callback propagation tests.
class AudioCapture {
companion object { var lastFrame: ((ByteArray) -> Unit)? = null; var lastError: ((Exception) -> Unit)? = null }
fun aecAvailability() = AecAvailability.UNKNOWN
fun start(onFrame: (ByteArray) -> Unit, onError: (Exception) -> Unit, onDiagnostic: (String) -> Unit = {}) { lastFrame = onFrame; lastError = onError; onDiagnostic("AudioRecord initialization ok") }
fun stop() {}
fun release() {}
}
class AudioPlayback(onDrained: (Long, Long) -> Unit, onError: (Long, Exception) -> Unit, onProgress: (Long, Long, String) -> Unit = { _, _, _ -> }) {
companion object { var interrupts = 0; var enqueued = 0 }
fun beginTurn(turn: Long) {}
fun endTurn(turn: Long) {}
fun enqueue(frame: DownlinkFrame): Boolean { enqueued++; return true }
fun isCurrent(turn: Long, epoch: Long) = true
fun isCurrent(epoch: Long) = true
fun interrupt() { interrupts++ }
fun release() {}
}