aws-samples / amazon-polly-metahumans

This Unreal Engine sample project demonstrates how to bring Epic Games' MetaHuman digital characters to life using the Amazon Polly text-to-speech service from AWS. Use this project as a starting point for creating your own Unreal Engine applications that leverage Amazon Polly to give voice to your MetaHumans.
MIT No Attribution
178 stars 67 forks source link

The speech component crashes #9

Closed Legumtechnica closed 2 years ago

Legumtechnica commented 2 years ago

The editor crashes as soon as the Speak function is executed. In debug mode, it hits a breakpoint, and when I press "continue" in VS, it resumes. Please help. I'm really close

Legumtechnica commented 2 years ago

@rukekre

cwalkere commented 2 years ago

What version of Unreal Engine are you using? This was only tested using UE4.26. And, are you using Windows or Mac? I'll try to re-download this project later this week and see if I can reproduce some issues/debug. Also if you open up the log window, does it print any useful error messages?

Legumtechnica commented 2 years ago

It was an issue with aws-cpp-sdk, works fine for now.

I'm using UE5 and VS 2022

Thanks man, for the great work

mohanzalake commented 2 years ago

Facing the same issue. How did you resolve it? Is it related to the CUSTOM_MEMORY_MANAGEMENT flag during cmake? I had to switch off -DCUSTOM_MEMORY_MANAGEMENT during cmake to avoid build fail.

Krxtopher commented 2 years ago

I have seen a crash similar to this happen if the "speak" function is called too rapidly after the scene first starts. I think this may be related to some asynchronous initialization step that our code hasn't properly accounted for. See if adding a delay before your call the "speak" function helps avoid the crash.

mohanzalake commented 2 years ago

Added a 2s delay before calling speak function - didn't help. Like @Ishu07 mentioned, it hits breakpoint in debug mode. However, the issue doesn't appear in subsequent runs. It only happens after the first UE project launch.

Upon further debugging, I found the issue appears when executing following line of code in PollyClient.cpp: AwsPollyClient = MakeUnique(configuration);

Here's the exception that is thrown in memory: Unhandled exception at 0x00007FFBE222C729 (ntdll.dll) in UE4Editor-Win64-DebugGame.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFBE2297780).

Legumtechnica commented 2 years ago

Rebuilding aws-sdk-cpp manually helped me.

Just refer the .bat file in /source Follow the commands. Debug and build.

Then run the project