PollyOutcome PollyClient::SynthesizeSpeech()

in Source/AmazonPollyMetaHuman/Private/PollyClient.cpp [33:45]


PollyOutcome PollyClient::SynthesizeSpeech(const Aws::Polly::Model::SynthesizeSpeechRequest& SpeechRequest) {
    PollyOutcome Outcome;
    Aws::Polly::Model::SynthesizeSpeechOutcome SpeechOutcome = AwsPollyClient->SynthesizeSpeech(SpeechRequest);
    if (SpeechOutcome.IsSuccess()) {
        Outcome.StreamBuffer = UnrealAWSUtils::PreparePollyData(SpeechOutcome.GetResult().GetAudioStream());
        Outcome.IsSuccess = true;
    }
    else {
        Outcome.IsSuccess = false;
        Outcome.PollyErrorMsg = SpeechOutcome.GetError().GetMessage();
    }
    return Outcome;
}