in Source/AmazonPollyMetaHuman/Private/SpeechComponent.cpp [135:147]
bool USpeechComponent::SynthesizeVisemes(const FString& Text, const EVoiceId VoiceId) {
PollyOutcome PollyVisemeOutcome = MyPollyClient->SynthesizeSpeech(CreatePollyVisemeRequest(Text, VoiceId));
if (PollyVisemeOutcome.IsSuccess) {
FScopeLock lock(&Mutex);
FString VisemeJson;
FFileHelper::BufferToString(VisemeJson, PollyVisemeOutcome.StreamBuffer.GetData(), PollyVisemeOutcome.StreamBuffer.Num());
GenerateVisemeEvents(VisemeJson);
}
else {
UE_LOG(LogPollyMsg, Error, TEXT("Polly failed to generate visemes. Error: %s"), *AwsStringToFString(PollyVisemeOutcome.PollyErrorMsg));
}
return PollyVisemeOutcome.IsSuccess;
}