Creating a custom voice
To create a custom voice, you provide recordings of one speaker, choose the language of the voice, and confirm the statements in Your responsibilities.
Recording requirements
The recordings must meet the requirements in the following table.
| Requirement | Value |
|---|---|
| Number of recordings | 1–10 per voice |
| Audio formats | WAV (wav), FLAC (flac), Ogg Vorbis
(ogg_vorbis), or MP3 (mp3). Set the
Format field of each recording to the value that
matches its audio. |
| Length of each recording | 10 seconds to 15 minutes. If any recording is shorter or
longer, voice creation fails and the voice status is
failed. |
| Total length | At most 15 minutes for all recordings together. If the total is longer, voice creation fails. |
| Content | Speech by one speaker, in the language of the voice. Amazon Polly doesn't detect the language. |
| Location | An Amazon Simple Storage Service (Amazon S3) object in the same Region as the Amazon Polly endpoint, or audio in the request. Audio in the request can be up to 5 MB per recording, before base64 encoding. |
Amazon Polly accepts any sample rate, bit depth, and number of channels. The custom voice learns from everything in the recordings, including noise and echo. For the best result, follow these recommendations:
-
Record 2–10 minutes of natural speech, split into takes of up to a minute each. Several short takes work better than one long file.
-
Record one speaker in a quiet room, at the same distance from the microphone.
-
Don't use meeting apps or browser recorders. Their echo cancellation and noise suppression change the voice.
-
Speak in the style that you want the voice to have.
-
Convert each take to WAV, mono, 16-bit, 24 kHz before you upload it. At 24 kHz, a one-minute take is about 2.9 MB.
Permissions for creating a custom voice
To create a custom voice and check its status, you must have the following permissions:
-
The
polly:CreateVoicepermission. -
The
polly:GetVoicepermission, to check the status of the voice. Thevoice-activewaiter also usesGetVoice. -
The
s3:GetObjectpermission on each recording that you specify with an Amazon S3 URL. You don't need a bucket policy that grants access to Amazon Polly. If the objects are encrypted with an AWS KMS key (SSE-KMS), you also need thekms:Decryptpermission on that key. -
The
polly:TagResourcepermission, if you add tags to the voice when you create it. -
The
kms:DescribeKey,kms:GenerateDataKey, andkms:Decryptpermissions on the key, if you encrypt the voice with a customer managed key. For more information, see Configuring permissions to use a customer managed key.
Prerequisites
Before you create a custom voice, make sure that you have the following:
-
Recordings that meet the Recording requirements. If you use Amazon S3 URLs, upload the recordings to a bucket in the Region where you want to create the voice.
-
The permissions in Permissions for creating a custom voice.
-
(Optional) A customer managed key that meets the Key requirements, if you don't want Amazon Polly to use an AWS owned key.
-
For the AWS CLI, the latest version. If the AWS CLI doesn't recognize the
create-voicecommand, update it. For more information, see Setting up the AWS CLI.
Creating a custom voice with the console or AWS CLI
During the preview, only approved AWS accounts can create custom voices, and only those accounts see the Voice Cloning tab in the Amazon Polly console. To get access, see Availability, languages, and pricing.
Options when you create a custom voice
You can specify the following optional settings in a CreateVoice
request.
- Customer managed key
-
To encrypt the voice with a customer managed key, specify the key ARN in the
KmsKeyArnfield ofCustomerManagedEncryption. In the AWS CLI, use--customer-managed-encryption '{"KmsKeyArn": ". The key must be a symmetric encryption key in the same Region as the voice. You can't change the key after you create the voice. For more information, see Encryption at rest.key-arn"}' - Tags
-
To add tags when you create the voice, specify them in
Tags. For more information, see Tagging Amazon Polly resources. - Client token
-
If you don't specify a
ClientToken, the AWS SDKs and the AWS CLI generate one. To retry a request that succeeded, use the same token and the same parameters. Amazon Polly then returns the voice from the first request and doesn't create another one. If you reuse a token with different parameters, the request fails withValidationException.