in Source/AmazonPollyMetaHuman/Private/SpeechComponent.cpp [47:63]
void USpeechComponent::GenerateSpeech(
UObject* WorldContextObject,
const FString Text,
const EVoiceId VoiceId,
struct FLatentActionInfo LatentActionInfo,
EGenerateSpeechExecPins& GenerateSpeechExecPins
) {
if (UWorld* World = GEngine->GetWorldFromContextObjectChecked(WorldContextObject)) {
FLatentActionManager& LatentActionManager = World->GetLatentActionManager();
UObject* CallbackTarget = LatentActionInfo.CallbackTarget;
int32 UUID = LatentActionInfo.UUID;
if (LatentActionManager.FindExistingAction<FPendingLatentAction>(CallbackTarget, UUID) == NULL) {
// LatentActionManager takes ownership of FGenerateSpeechAction (it calls delete).
LatentActionManager.AddNewAction(CallbackTarget, UUID, new FGenerateSpeechAction(LatentActionInfo, this, Text, VoiceId, GenerateSpeechExecPins));
}
}
}