mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
wip instruction decoding
This commit is contained in:
@@ -2,11 +2,27 @@
|
|||||||
|
|
||||||
FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
|
FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
|
||||||
{
|
{
|
||||||
FTtsRequest request = FTtsRequest();
|
FString input = payload;
|
||||||
|
|
||||||
request.Username = FString(TEXT("user"));
|
FString username = TEXT("");
|
||||||
request.VoiceName = FString(TEXT("sonic"));
|
FString voiceName = TEXT("");
|
||||||
request.Text = FString(TEXT("gotta go fast"));
|
FString text = TEXT("");
|
||||||
|
|
||||||
|
FString Left, Right;
|
||||||
|
|
||||||
|
if (input.Split(TEXT("|"), &Left, &input)) {
|
||||||
|
username = Left;
|
||||||
|
|
||||||
|
if (input.Split(TEXT("|"), &Left, &Right)) {
|
||||||
|
voiceName = Left;
|
||||||
|
text = Right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FTtsRequest request = FTtsRequest();
|
||||||
|
request.Username = username;
|
||||||
|
request.VoiceName = voiceName;
|
||||||
|
request.Text = text;
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
|
|
||||||
#include "ProtocolTypes.h"
|
#include "ProtocolTypes.h"
|
||||||
|
|
||||||
#include "ProtocolLibrary.generated.h"
|
#include "ProtocolLibrary.generated.h"
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
@@ -16,6 +15,7 @@ class EVENTCENTERPLUGIN_API UProtocolLibrary : public UBlueprintFunctionLibrary
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// Decode TTS instructions
|
||||||
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
||||||
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,24 +6,6 @@
|
|||||||
|
|
||||||
#include "ProtocolTypes.generated.h"
|
#include "ProtocolTypes.generated.h"
|
||||||
|
|
||||||
/*UCLASS()
|
|
||||||
class EVENTCENTERPLUGIN_API UTtsRequest : public UObject {
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
inline UTtsRequest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
|
||||||
FString Username;
|
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
|
||||||
FString VoiceName;
|
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
|
||||||
FString Text;
|
|
||||||
};*/
|
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|||||||
Reference in New Issue
Block a user