diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_ElevenLabsComponent.cpp b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_ElevenLabsComponent.cpp index 4363b45..38d2f4c 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_ElevenLabsComponent.cpp +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_ElevenLabsComponent.cpp @@ -901,21 +901,6 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::FeedExternalAudio(const TArray // (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 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& 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.