Integration: Amazon Polly Text-To-Speech
Unity SDK / Integration Guides / Amazon TTS
Don't forget to generate your didimos with support for Amazon Polly animation. See Built for Amazon Polly
To animate our didimos using text-to-speech, we support Amazon Polly's service, which you can find about more here. Our Meet a didimo scene has a demonstration of this integration that you can explore.
Note that for the TTS system, we use the DidimoSpeech component instead, which targets Amazon Polly and acts directly with the LegacyAnimationPoseController, without requiring the DidimoAnimator component.
Integration
Amazon TTS provides two files that are required to animate a didimo, which are a JSON text file as well as an audio file. See examples of JSON and mp3 files here. Using these two files you can try out our Text-To-Speech system by:
- going to the Package Manager and installing the "Example Animation Scripts" sample, from the Core Package
- adding our
DidimoAnimationExampleTtscomponent to your didimo - assigning the correct fields. You can use our example animation files in
Packages/com.didimo.sdk.core/Runtime/Content/TTS/ - enter Play mode
- play the TTS
Optionally, you can create your own script to trigger the animation as well
// TTS Variables
public TextAsset ttsData;
public AudioClip ttsClip;
// Play TTS Function
public void PlayTts() {
Didimo.Speech.Phrase ttsPhrase = Didimo.Speech.Phrase.Build(ttsData.bytes, ttsClip);
didimoComponents.Speech.Speak(ttsPhrase);
}Updated 5 months ago
