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 7d418ed..dcd3af7 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 @@ -256,7 +256,6 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::StartConversation_Internal() // Pass configuration to the proxy before connecting. WebSocketProxy->TurnMode = TurnMode; - WebSocketProxy->bSpeculativeTurn = bSpeculativeTurn; WebSocketProxy->Connect(AgentID); } diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.cpp b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.cpp index ab8af88..49e3fb2 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.cpp +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.cpp @@ -7,26 +7,10 @@ #include "IWebSocket.h" #include "Json.h" -#include "JsonUtilities.h" #include "Misc/Base64.h" DEFINE_LOG_CATEGORY_STATIC(LogPS_AI_ConvAgent_WS_ElevenLabs, Log, All); -// ───────────────────────────────────────────────────────────────────────────── -// Helpers -// ───────────────────────────────────────────────────────────────────────────── -static void EL_LOG(bool bVerbose, const TCHAR* Format, ...) -{ - if (!bVerbose) return; - va_list Args; - va_start(Args, Format); - // Forward to UE_LOG at Verbose level - TCHAR Buffer[2048]; - FCString::GetVarArgs(Buffer, UE_ARRAY_COUNT(Buffer), Format, Args); - va_end(Args); - UE_LOG(LogPS_AI_ConvAgent_WS_ElevenLabs, Verbose, TEXT("%s"), Buffer); -} - // ───────────────────────────────────────────────────────────────────────────── // Connect / Disconnect // ───────────────────────────────────────────────────────────────────────────── diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent.h index 560f0c3..922afd9 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent.h @@ -15,14 +15,6 @@ class PS_AI_CONVAGENT_API UPS_AI_ConvAgent_Settings_ElevenLabs : public UObject GENERATED_BODY() public: - UPS_AI_ConvAgent_Settings_ElevenLabs(const FObjectInitializer& ObjectInitializer) - : Super(ObjectInitializer) - { - API_Key = TEXT(""); - AgentID = TEXT(""); - bSignedURLMode = false; - } - /** * ElevenLabs API key. * Obtain from https://elevenlabs.io – used to authenticate WebSocket connections. @@ -38,23 +30,6 @@ public: UPROPERTY(Config, EditAnywhere, Category = "PS AI ConvAgent|ElevenLabs API") FString AgentID; - /** - * When true, the plugin fetches a signed WebSocket URL from your own backend - * before connecting, so the API key is never exposed in the client. - * Set SignedURLEndpoint to point to your server that returns the signed URL. - */ - UPROPERTY(Config, EditAnywhere, Category = "PS AI ConvAgent|ElevenLabs API|Security") - bool bSignedURLMode; - - /** - * Your backend endpoint that returns a signed WebSocket URL for ElevenLabs. - * Only used when bSignedURLMode = true. - * Expected response body: { "signed_url": "wss://..." } - */ - UPROPERTY(Config, EditAnywhere, Category = "PS AI ConvAgent|ElevenLabs API|Security", - meta = (EditCondition = "bSignedURLMode")) - FString SignedURLEndpoint; - /** * Override the ElevenLabs WebSocket base URL. Leave empty to use the default: * wss://api.elevenlabs.io/v1/convai/conversation diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_Definitions.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_Definitions.h index 4ce6f00..eed1065 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_Definitions.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_Definitions.h @@ -36,8 +36,6 @@ namespace PS_AI_ConvAgent_MessageType_ElevenLabs { // Client → Server static const FString AudioChunk = TEXT("user_audio_chunk"); - // Client turn mode: signal user is currently active/speaking - static const FString UserActivity = TEXT("user_activity"); // Client turn mode: send a text message without audio static const FString UserMessage = TEXT("user_message"); static const FString Interrupt = TEXT("interrupt"); @@ -55,7 +53,6 @@ namespace PS_AI_ConvAgent_MessageType_ElevenLabs static const FString InterruptionEvent = TEXT("interruption"); static const FString PingEvent = TEXT("ping"); static const FString ClientToolCall = TEXT("client_tool_call"); - static const FString InternalTentativeAgent = TEXT("internal_tentative_agent_response"); } // ───────────────────────────────────────────────────────────────────────────── diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_ElevenLabsComponent.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_ElevenLabsComponent.h index bde0d8c..aa99b0c 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_ElevenLabsComponent.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_ElevenLabsComponent.h @@ -125,11 +125,6 @@ public: meta = (ToolTip = "Auto-open the microphone when the conversation starts.\nOnly applies in Server VAD mode. In push-to-talk mode, call StartListening() manually.")) bool bAutoStartListening = true; - /** Let the LLM start generating a response during silence, before the VAD is fully confident the user has finished speaking. Saves 200-500ms of latency but may be unstable in long multi-turn sessions. Disabled by default. */ - UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PS AI ConvAgent|ElevenLabs|Latency", - meta = (ToolTip = "Speculative turn: the LLM begins generating during silence before full turn-end confidence.\nReduces latency by 200-500ms. May be unstable in long sessions — test before enabling in production.")) - bool bSpeculativeTurn = false; - /** How many milliseconds of microphone audio to accumulate before sending a chunk to ElevenLabs. Lower values reduce latency but may degrade voice detection accuracy. Higher values are more reliable but add delay. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PS AI ConvAgent|ElevenLabs|Latency", meta = (ClampMin = "20", ClampMax = "500", @@ -545,10 +540,6 @@ private: TArray AudioQueue; FCriticalSection AudioQueueLock; - // Reusable zero-filled buffer fed to USoundWaveProcedural during TTS gaps - // to keep the audio component alive (prevents stop on buffer underrun). - TArray SilenceBuffer; - // Pre-buffer state: delay playback start to absorb TTS inter-chunk gaps. bool bPreBuffering = false; double PreBufferStartTime = 0.0; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_EmotionPoseMap.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_EmotionPoseMap.h index 9454267..8504727 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_EmotionPoseMap.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_EmotionPoseMap.h @@ -4,7 +4,6 @@ #include "CoreMinimal.h" #include "Engine/DataAsset.h" -#include "Engine/AssetManager.h" #include "PS_AI_ConvAgent_Definitions.h" #include "PS_AI_ConvAgent_EmotionPoseMap.generated.h" diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_InteractionComponent.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_InteractionComponent.h index 061e1a3..32f17cb 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_InteractionComponent.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_InteractionComponent.h @@ -210,9 +210,6 @@ private: UPROPERTY() UPS_AI_ConvAgent_MicrophoneCaptureComponent* MicComponent = nullptr; - /** True while ForceSelectAgent is active (suppresses automatic re-evaluation for one frame). */ - bool bForceSelectionActive = false; - // ── Posture timers ─────────────────────────────────────────────────────── FTimerHandle PostureAttachTimerHandle; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncComponent.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncComponent.h index 11df709..f3d33ca 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncComponent.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncComponent.h @@ -261,9 +261,6 @@ private: // with fast attack (mouth opens quickly) and slow release (closes gradually). float AudioEnvelopeValue = 0.0f; - // Whether we have pending analysis results to process - bool bHasPendingAnalysis = false; - // ── Text-driven lip sync ────────────────────────────────────────────────── // Accumulated partial text from streaming (agent_chat_response_part events). diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncPoseMap.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncPoseMap.h index 63270b8..18d7198 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncPoseMap.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_LipSyncPoseMap.h @@ -4,7 +4,6 @@ #include "CoreMinimal.h" #include "Engine/DataAsset.h" -#include "Engine/AssetManager.h" #include "PS_AI_ConvAgent_LipSyncPoseMap.generated.h" class UAnimSequence; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.h index 9b9af3c..110e07a 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Public/PS_AI_ConvAgent_WebSocket_ElevenLabsProxy.h @@ -261,7 +261,4 @@ public: // Set by UPS_AI_ConvAgent_ElevenLabsComponent before calling Connect(). // Controls turn_timeout in conversation_initiation_client_data. EPS_AI_ConvAgent_TurnMode_ElevenLabs TurnMode = EPS_AI_ConvAgent_TurnMode_ElevenLabs::Server; - - // Speculative turn: start LLM generation during silence before full turn confidence. - bool bSpeculativeTurn = true; };