Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.
Gen1 DocsLegacy
NewDeploy web apps with Git or your AI coding agent using the latest AWS Amplify. Add managed databases and authentication as you grow. Explore the documentation.
NoticeAmplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027.

Text to speech

These docs cover Amplify Gen 2. For new web apps, we recommend the latest AWS Amplify, with a simplified CLI and native integrations for databases, storage, and AI models. Get started with the latest AWS Amplify.

Note: Make sure to complete the getting started section first, where you will set up the IAM roles with the right policy actions

Working with the API

Generate an audio buffer for playback from a text input.

import { Predictions } from '@aws-amplify/predictions';
const result = await Predictions.convert({
textToSpeech: {
source: {
text: textToGenerateSpeech
},
voiceId: "Amy"
}
})

To view the complete list of voiceId options refer to Voices in Amazon Polly.