Add bounded native playback diagnostics and sensor-free dance inspection

This commit is contained in:
zenord
2026-10-13 11:43:38 +08:00
parent 3458a9b03e
commit f9c45a3c4e
16 changed files with 400 additions and 53 deletions
+19
View File
@@ -4,6 +4,7 @@ import com.gorios.lanvoice.avatar.*
import com.gorios.lanvoice.net.*
fun checkActionSession() {
checkLocalPreviewCaptureFence()
checkActionFollowupSession()
val sha="a".repeat(64);val states=mutableListOf<VoiceUiState>()
val prepared=mutableListOf<com.gorios.lanvoice.dialogue.ReplyEmotion?>()
@@ -102,3 +103,21 @@ fun checkActionFollowupSession() {
session.release();AudioPlayback.activityFence=null
println("PASS: client normal action completion/new server speech turn accepted, future after emotion hidden, retired pre audio/emotion/drain rejected, independent after drain and duplicate completion fence; deterministic doubles only")
}
fun checkLocalPreviewCaptureFence() {
AudioCapture.confirmStopsAutomatically=false
val s=VoiceSession("localhost",5011,{})
val results=mutableListOf<Boolean>()
s.suspendForLocalPreview(results::add);Handler.drain()
check(results.isEmpty())
AudioCapture.lastStopped!!(false);Handler.drain();check(results==listOf(false))
AudioCapture.lastStopped!!(true);Handler.drain();check(results==listOf(false))
s.suspendForLocalPreview(results::add);AudioCapture.lastStopped!!(true);Handler.drain()
check(results==listOf(false,true))
s.suspendForLocalPreview(results::add);s.foreground(connectAutomatically=false)
AudioCapture.lastStopped!!(true);Handler.drain();check(results.last()==false)
s.suspendForLocalPreview(results::add);val stale=AudioCapture.lastStopped!!;s.release()
stale(true);Handler.drain();check(results.last()==false)
AudioCapture.confirmStopsAutomatically=true
println("PASS:6 production local-preview capture cleanup/unconfirmed/duplicate/foreground/release callback fences; AudioRecord double, device not_run")
}