Integration: Text-To-Speech

Unity SDK / Integration Guides / Amazon TTS

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. Using these two files you can try out our Text-To-Speech system by:

  • adding our DidimoAnimationExampleTts script to your didimo
  • assigning the correct fields
  • 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);
}

Did this page help you?