Fix UserSpeechMs growing indefinitely in Server VAD mode
TurnStartTime was only set in StartListening(), which is called once. In Server VAD + interruption mode the mic stays open, so TurnStartTime was never updated between turns. Now reset TurnStartTime when the agent stops speaking (normal end + interruption), marking the start of the next potential user turn. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a8dd5a022f
commit
56b072c45e
@ -279,6 +279,7 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::TickComponent(float DeltaTime, ELevel
|
|||||||
bHardTimeoutFired = bHardTimeout && !bAgentResponseReceived;
|
bHardTimeoutFired = bHardTimeout && !bAgentResponseReceived;
|
||||||
bAgentSpeaking = false;
|
bAgentSpeaking = false;
|
||||||
bPreBuffering = false; // Cancel pending pre-buffer to prevent stale OnAudioPlaybackStarted.
|
bPreBuffering = false; // Cancel pending pre-buffer to prevent stale OnAudioPlaybackStarted.
|
||||||
|
TurnStartTime = FPlatformTime::Seconds(); // Mark start of next potential user turn.
|
||||||
bAgentResponseReceived = false;
|
bAgentResponseReceived = false;
|
||||||
SilentTickCount = 0;
|
SilentTickCount = 0;
|
||||||
bShouldBroadcastStopped = true;
|
bShouldBroadcastStopped = true;
|
||||||
@ -1516,6 +1517,7 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::StopAgentAudio()
|
|||||||
SilentTickCount = 0;
|
SilentTickCount = 0;
|
||||||
bWasSpeaking = true;
|
bWasSpeaking = true;
|
||||||
Now = FPlatformTime::Seconds();
|
Now = FPlatformTime::Seconds();
|
||||||
|
TurnStartTime = Now; // Mark start of next potential user turn.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user