---
title: "Text to speech"
section: "frontend/predictions"
platforms: ["angular", "javascript", "nextjs", "react", "react-native", "vue"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/frontend/predictions/text-to-speech/"
---

export async function getStaticPaths() {
  return getCustomStaticPath(meta.platforms);
}

<Callout informational>

**Note:** Make sure to complete the [getting started](/[platform]/build-a-backend/add-aws-services/predictions/set-up-predictions/) section first, where you will set up the IAM roles with the right policy actions

</Callout>

## Working with the API

Generate an audio buffer for playback from a text input.

```ts
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](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html).
