fix: audio frame sequence starts at 1 (server expects up_seq+1)
Server up_seq starts at 0, expects first frame seq=1. Client sent seq=0, triggering sequence gap error and ws close 1008 after ~22 frames (450ms). Also: version 0.3.2
This commit is contained in:
@@ -36,7 +36,7 @@ class VoiceSession(
|
||||
private var hasTurn = false
|
||||
private val retiredTurns = mutableSetOf<Long>()
|
||||
private var blockedTurn: Long? = null
|
||||
private var sequence = 0L
|
||||
private var sequence = 1L
|
||||
private val capture = AudioCapture()
|
||||
private val playback: AudioPlayback = AudioPlayback(
|
||||
onDrained = { turn, epoch ->
|
||||
@@ -161,7 +161,7 @@ class VoiceSession(
|
||||
hasTurn = false
|
||||
retiredTurns.clear()
|
||||
blockedTurn = null
|
||||
sequence = 0
|
||||
sequence = 1
|
||||
update(state.copy(connection = connection, voiceActive = false, phase = VoicePhase.IDLE))
|
||||
} else update(state.copy(
|
||||
connection = connection,
|
||||
@@ -298,7 +298,7 @@ class VoiceSession(
|
||||
playback.interrupt()
|
||||
currentTurn = id
|
||||
hasTurn = true
|
||||
sequence = 0
|
||||
sequence = 1
|
||||
if (blockedTurn != id) blockedTurn = null
|
||||
}
|
||||
if (logDecision) diagnostic("acceptTurn $before accepted=true nextTurn=$currentTurn nextBlocked=$blockedTurn retiredNow=${retiredTurns.size}")
|
||||
|
||||
Reference in New Issue
Block a user