A sample project combining Epic Games' MetaHuman digital characters with Amazon Polly text-to-speech.
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 using one of 16 different English language voices spanning 5 dialects. Or extend this project to use any of Polly's 60+ voices covering 20+ languages and 13+ dialects.
Polly.MetaHuman.1080p.mov
With Amazon Polly, you only pay for what you use. You are charged based on the number of characters of text that you convert either to speech audio or to speech metadata. In addition, you can cache and replay Amazon Polly’s generated speech at no additional cost. For full pricing details, see Amazon Polly Pricing.
Contents
🛑 Before proceeding you must have Unreal Engine 4.26 or later installed as well as the Microsoft Visual Studio development tools required for UE4 C++ development (Windows) or the Xcode development tools (Mac). If you need help with these setup steps, refer to the Unreal Engine 4 documentation, especially "Setting Up Visual Studio for Unreal Engine".
In order for this Unreal Engine project to interact with the Amazon Polly service, you must provide it with AWS credentials that allow access to that service. The easiest way to generate these credentials is to create a new AWS Identity Access & Management (IAM) user in your AWS account.
Create a new IAM user and assign to it the permissions policy named "AmazonPollyReadOnlyAccess". Although the name you give this user is not important, we suggest naming it "MetaHumans Sample" or something equally distinctive. Be sure to save the Access Key ID and the Secret Access Key that are generated during the user creation process. You'll need them later.
💡 Tip: For more help, see "Creating an IAM user in your AWS account" in the AWS IAM documentation.
You will need to configure your local computer to communicate with AWS services using the credentials you created above. The easiest way to do this is to install and configure the AWS Command Line Interface (AWS CLI).
Install the AWS CLI to your local computer following these instructions.
Use the aws configure
command to create a default profile for the AWS CLI. Be sure to use the Access Key ID and Secret Access Key values you saved above.
💡 Tip: For more help, see "Configuration basics" in the AWS CLI documentation.
🛑 This next step requires cmake. If you don't already have cmake installed, you can download it here. After you download cmake, launch cmake and click 'Tools' -> 'How To Install For Command Line Use' and follow one of the instructions. E.g. for Mac - One may add CMake to the PATH: PATH="/Applications/CMake.app/Contents/bin":"$PATH"
This project makes use of the C++ Polly API – a part of the AWS SDK for C++ – to communicate with the Polly service. We've provided scripts to automatically download and compile the appropriate binaries for you. Run one of the following scripts:
Windows: Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/BuildAwsSdkWin64.bat
Mac: Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/BuildAwsSdkMac.sh
Open the project by double-clicking on the AmazonPollyMetaHuman.uproject file.
Click "Yes" on the dialog that appears.
To try out the project, simply click the "Play" button in the Unreal Engine editor. The MetaHuman will come alive using speech and lip sync generated by Amazon Polly. After the MetaHuman stops speaking you can enter your own custom speech text into the on-screen text field.
⚠️ Wait until the "Compiling Shaders" process completes before running this project for the first time.
🛠 Troubleshooting: This project includes extensive error messaging that can help you debug common problems. If the project doesn't work properly, open the Output Log tab in the Unreal Engine editor and look for error messages.
This repository includes a full Developer Guide which describes the project's architecture and explains how to customize the project with your own MetaHuman characters.
If you have questions as you explore this sample project post them to the Issues section of this repository. To report bugs, request new features, or contribute to this open source project see CONTRIBUTING.md.
See CONTRIBUTING for more information.
This sample code is licensed under the MIT-0 License. See the LICENSE file.