ElevenLabs: remove temporary [MIC-DBG] mic uplink diagnostics

Client mic uplink confirmed working in a packaged build across two PCs
(networked Server VAD): the agent now replies to the player's voice.
Remove the [MIC-DBG]/[MIC-DBG-SRV] instrumentation added to trace it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 14:27:39 +02:00
parent c2ca2e3dbb
commit ab2482a209

View File

@@ -901,21 +901,6 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::FeedExternalAudio(const TArray<float>
// (e.g. InteractionComponent on the pawn) instead of a local mic component.
// On server: check local WebSocket. On client: check replicated conversation state.
const bool bCanSend = (GetOwnerRole() == ROLE_Authority) ? IsConnected() : bNetIsConversing;
// [MIC-DBG] TEMP diagnostic — remove once the client uplink is fixed.
{
static double GMicDbgLast = 0.0;
const double NowDbg = FPlatformTime::Seconds();
if (NowDbg - GMicDbgLast > 1.0)
{
GMicDbgLast = NowDbg;
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Warning,
TEXT("[MIC-DBG] FeedExternalAudio Role=%d bCanSend=%d bIsListening=%d bNetIsConversing=%d bAgentSpeaking=%d samples=%d"),
(int32)GetOwnerRole(), bCanSend ? 1 : 0, bIsListening ? 1 : 0,
bNetIsConversing ? 1 : 0, bAgentSpeaking.load() ? 1 : 0, FloatPCM.Num());
}
}
if (!bCanSend || !bIsListening) return;
// Echo suppression: skip sending mic audio while the agent is speaking.
@@ -984,16 +969,7 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::FeedExternalAudio(const TArray<float>
else
{
// Route through relay (clients can't call Server RPCs on NPC actors).
auto* Relay = FindLocalRelayComponent();
// [MIC-DBG] TEMP diagnostic — remove once the client uplink is fixed.
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Warning,
TEXT("[MIC-DBG] client send %d bytes via relay=%s opus=%s"),
MicAccumulationBuffer.Num(),
Relay ? TEXT("FOUND") : TEXT("NULL (-> direct NPC RPC, will be dropped)"),
OpusEncoder.IsValid() ? TEXT("yes") : TEXT("no(raw)"));
if (Relay)
if (auto* Relay = FindLocalRelayComponent())
{
// Opus-compress mic audio before sending over the network.
// 3200 bytes raw PCM → ~200 bytes Opus (~16x reduction).
@@ -2360,23 +2336,6 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::ServerSendMicAudio_Implementation(
void UPS_AI_ConvAgent_ElevenLabsComponent::ServerSendMicAudioFromPlayer(
APawn* SpeakerPawn, const TArray<uint8>& PCMBytes)
{
// [MIC-DBG] TEMP diagnostic — remove once the client uplink is fixed.
{
static double GMicSrvDbgLast = 0.0;
const double NowDbg = FPlatformTime::Seconds();
if (NowDbg - GMicSrvDbgLast > 1.0)
{
GMicSrvDbgLast = NowDbg;
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Warning,
TEXT("[MIC-DBG-SRV] ServerSendMicAudioFromPlayer reached: from=%s players=%d active=%s wsConnected=%d bytes=%d"),
SpeakerPawn ? *SpeakerPawn->GetName() : TEXT("NULL"),
NetConnectedPawns.Num(),
NetActiveSpeakerPawn ? *NetActiveSpeakerPawn->GetName() : TEXT("none"),
(WebSocketProxy && WebSocketProxy->IsConnected()) ? 1 : 0,
PCMBytes.Num());
}
}
if (!WebSocketProxy || !WebSocketProxy->IsConnected()) return;
// Standalone / single-player: bypass speaker arbitration entirely.