this works! command parsing for spawn and tts

This commit is contained in:
Brandon Thomas
2021-03-08 08:06:52 -05:00
parent 019b3e8b7e
commit c1dd44a08b
4 changed files with 56 additions and 6 deletions
@@ -13,20 +13,38 @@ FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
if (input.Split(TEXT("|"), &Left, &input)) {
username = Left;
if (input.Split(TEXT("|"), &Left, &Right)) {
if (input.Split(TEXT(" "), &Left, &Right)) {
voiceName = Left;
text = Right;
}
}
FTtsRequest request = FTtsRequest();
request.Username = username;
request.VoiceName = voiceName;
request.Text = text;
request.Username = username.TrimStartAndEnd();
request.VoiceName = voiceName.TrimStartAndEnd();
request.Text = text.TrimStartAndEnd();
return request;
}
/*void UProtocolLibrary::DecodeTtsPayload()
FSpawnRequest UProtocolLibrary::DecodeSpawnPayload(const FString& payload)
{
}*/
FString input = payload;
FString username = TEXT("");
FString model = TEXT("");
FString Left, Right;
if (input.Split(TEXT("|"), &Left, &Right)) {
username = Left;
model = Right;
}
FSpawnRequest request = FSpawnRequest();
request.Username = username.TrimStartAndEnd();
request.Model = model.TrimStartAndEnd();
return request;
}
@@ -18,4 +18,8 @@ public:
// Decode TTS instructions
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
static FTtsRequest DecodeTtsPayload(const FString& payload);
// Decode Spawn instructions
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
static FSpawnRequest DecodeSpawnPayload(const FString& payload);
};
@@ -6,6 +6,9 @@
#include "ProtocolTypes.generated.h"
/**
* Text to speech instructions.
*/
USTRUCT(BlueprintType)
struct EVENTCENTERPLUGIN_API FTtsRequest {
GENERATED_BODY()
@@ -21,3 +24,18 @@ public:
FString Text;
};
/**
* Spawn instructions
*/
USTRUCT(BlueprintType)
struct EVENTCENTERPLUGIN_API FSpawnRequest {
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
FString Username;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
FString Model;
};
+10
View File
@@ -11,8 +11,18 @@ from aioredis.pubsub import Receiver
from aioredis.abc import AbcChannel
CHANNELS = [
# Text to speech
'tts',
'say',
'vocode',
# Object generation
'spawn',
# Teleport
'warp',
# Misc
'testing',
]