Creates a custom voice from recordings of a speaker and returns it in pending status. Use GetVoice to check the status. When the status is active , you can use the voice ID in SynthesizeSpeech , StartSpeechSynthesisTask , and StartSpeechSynthesisStream .
The custom-voice-max-count service quota limits the number of custom voices in your account in each Region. If you reach the quota, the request fails with ServiceQuotaExceededException .
This operation requires permissions to perform the polly:CreateVoice action. You also need s3:GetObject permission on each recording that you specify by S3Url . If you specify a customer managed key, you also need kms:DescribeKey , kms:GenerateDataKey , and kms:Decrypt permissions on the key. If you specify Tags , you also need the polly:TagResource permission.
See also: AWS API Documentation
create-voice
--name <value>
--language-code <value>
--terms-accepted | --no-terms-accepted
--voice-creation-data <value>
[--customer-managed-encryption <value>]
[--tags <value>]
[--client-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
--name (string) [required]
The name of the voice. Use the name to identify the voice in your application. The name can contain letters, digits, hyphens, and underscores, and can be up to 64 characters long. The name doesn’t have to be unique. The name isn’t the voice ID, which Amazon Polly assigns.
Constraints:
- min:
1- max:
64- pattern:
^[a-zA-Z0-9_-]+$
--language-code (string) [required]
The language of the recordings, for example,
en-US. Amazon Polly doesn’t detect the language from the recordings.Possible values:
de-DEen-USes-USfr-FRhi-INit-ITpt-BR
--terms-accepted | --no-terms-accepted (boolean) [required]
Confirms the following two statements:
- “I confirm that I have obtained all necessary consents required under any applicable laws and regulations, including biometric privacy laws, from the owner of this voice to clone these voice samples.”
- “I confirm that I will not use the generated content for any illegal, fraudulent, or harmful purpose and reaffirm my obligation to abide by the AWS Service Terms, Biometric Notice and Consent Terms, AWS Responsible AI Policy, and AWS Acceptable Use Policy.”
You can read the AWS Service Terms , the Biometric Notice and Consent Terms , the AWS Responsible AI Policy , and the AWS Acceptable Use Policy on the Amazon Web Services website.
You must set this parameter to
trueto create a voice. Otherwise, the request fails withValidationException.
--voice-creation-data (structure) [required]
The recordings that Amazon Polly uses to create the voice.
Recordings -> (list) [required]
The recordings of the speaker. Each recording specifies its audio format and its audio source.
Constraints:
- min:
1- max:
10(structure)
A recording of the speaker whose voice you want to create. The recording specifies its audio format and its audio source.
Format -> (string) [required]
The audio format of the recording:
wav,flac,ogg_vorbis, ormp3. The format must match the audio data.Possible values:
wavflacogg_vorbismp3Data -> (structure) [required]
The audio source of the recording. Specify either an Amazon S3 object or the audio data.
S3Url -> (string)
The Amazon S3 URL of the audio object, in the form
s3://bucket/key. You needs3:GetObjectpermission on the object.Constraints:
- max:
1024- pattern:
^s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9]/.+$Bytes -> (blob)
The audio data, passed directly in the request. The data must be in the format that
Formatspecifies and can be up to 5 MB. Amazon Polly doesn’t store the audio after it creates the voice, and doesn’t return this field in responses.Constraints:
- max:
5242880
JSON Syntax:
{
"Recordings": [
{
"Format": "wav"|"flac"|"ogg_vorbis"|"mp3",
"Data": {
"S3Url": "string",
"Bytes": blob
}
}
...
]
}
--customer-managed-encryption (structure)
The customer managed key that you want Amazon Polly to encrypt the voice with. If you omit this parameter, Amazon Polly encrypts the voice with an Amazon Web Services owned key.
KmsKeyArn -> (string) [required]
The Amazon Resource Name (ARN) of the key. The key must be a symmetric encryption key in the same Amazon Web Services Region as the voice. To create the voice, you need
kms:DescribeKey,kms:GenerateDataKey, andkms:Decryptpermissions on the key. To synthesize speech with the voice, you needkms:Decryptpermission on the key.Constraints:
- min:
20- max:
2048- pattern:
^arn:aws(-(cn|iso(-b)?|us-gov|eusc))?:kms:[a-z0-9_-]{1,50}:\d{12}:key/[a-zA-Z0-9-]+$EncryptionContext -> (map)
The key-value pairs that Amazon Polly includes as the encryption context when it encrypts or decrypts the voice with the key. You can use these pairs in key policy conditions. Don’t use keys that start with
aws:, which are reserved.Constraints:
- max:
10key -> (string)
Constraints:
- min:
1- max:
128value -> (string)
Constraints:
- min:
1- max:
256
Shorthand Syntax:
KmsKeyArn=string,EncryptionContext={KeyName1=string,KeyName2=string}
JSON Syntax:
{
"KmsKeyArn": "string",
"EncryptionContext": {"string": "string"
...}
}
--tags (map)
The tags that you apply to the voice to help you categorize and organize it. Each tag consists of a key and an optional value, both of which you define.
Constraints:
- min:
1- max:
200key -> (string)
Constraints:
- min:
1- max:
128value -> (string)
Constraints:
- min:
0- max:
256
Shorthand Syntax:
KeyName1=string,KeyName2=string
JSON Syntax:
{"string": "string"
...}
--client-token (string)
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDKs generate one for you. If you retry a request that succeeded with the same client token and the same parameters, Amazon Polly returns the voice that the first request created and doesn’t create a second voice.
Constraints:
- min:
1- max:
64- pattern:
^[!-~]+$
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
--cli-error-format (string)
The formatting style for error output. By default, errors are displayed in enhanced format.
--help (boolean)
Display help for the command/subcommand.
Voice -> (structure)
The new voice, in
pendingstatus.Arn -> (string)
The Amazon Resource Name (ARN) of a custom voice, in the form
arn:partition:polly:region:account-id:voice/voice-id.CreateVoiceandGetVoicereturn this field. Voices that Amazon Polly provides don’t have an ARN.Constraints:
- pattern:
^arn:aws(-(cn|iso(-b)?|us-gov|eusc))?:polly:[a-z0-9_-]{1,50}:\d{12}:voice/[a-zA-Z0-9_-]+$Gender -> (string)
The gender of the voice. Custom voices don’t include this field.
Possible values:
FemaleMaleId -> (string)
The voice ID that Amazon Polly assigns. You specify this ID when you call the
SynthesizeSpeechoperation. For a custom voice, Amazon Polly assigns an ID that consists ofvc-followed by hexadecimal characters, for example,vc-9a8fa85dd3.Possible values:
AditiAmyAstridBiancaBrianCamilaCarlaCarmenCelineChantalConchitaCristianoDoraEmmaEnriqueEwaFilizGabrielleGeraintGiorgioGwynethHansInesIvyJacekJanJoannaJoeyJustinKarlKendraKevinKimberlyLeaLivLotteLuciaLupeMadsMajaMarleneMathieuMatthewMaximMiaMiguelMizukiNajaNicoleOliviaPenelopeRaveenaRicardoRubenRussellSalliSeoyeonTakumiTatyanaVickiVitoriaZeinaZhiyuAriaAyandaArletHannahArthurDanielLiamPedroKajalHiujinLauraElinIdaSuviOlaHalaAndresSergioRemiAdrianoThiagoRuthStephenKazuhaTomokoNiamhSofieLisaIsabelleZaydDanielleGregoryBurcuJitkaSabrinaJasmineJihyeAmbreBeatriceFlorianLennartLorenzoTiffanyArjunCarlosCarolinaCurtisHyundukKennethKiaraLeoNateTinaLanguageCode -> (string)
Language code of the voice.
Possible values:
arbcmn-CNcy-GBda-DKde-DEen-AUen-GBen-GB-WLSen-INen-USes-ESes-MXes-USfr-CAfr-FRis-ISit-ITja-JPhi-INko-KRnb-NOnl-NLpl-PLpt-BRpt-PTro-ROru-RUsv-SEtr-TRen-NZen-ZAca-ESde-ATyue-CNar-AEfi-FIen-IEnl-BEfr-BEcs-CZde-CHen-SGLanguageName -> (string)
Human readable name of the language in English.Name -> (string)
The name of the voice, for example, Salli or Kendra. The name is human-readable, and you might display it in your application. For a custom voice, this is theNamethat you specified inCreateVoice.Origin -> (string)
Indicates who provides the voice. The origin is one of the following:
awsA voice that Amazon Polly provides.
customerA custom voice that you created with
CreateVoice.Possible values:
awscustomerStatus -> (string)
The status of a custom voice. Voices that Amazon Polly provides don’t include this field. The status is one of the following:
pendingAmazon Polly is creating the voice.
activeThe voice is ready for speech synthesis.
failedAmazon Polly couldn’t create the voice.
StatusReasondescribes why.Possible values:
pendingactivefailedStatusReason -> (string)
Additional information about the status of a custom voice. When the status isfailed, this field describes why Amazon Polly couldn’t create the voice.AdditionalLanguageCodes -> (list)
Additional codes for languages available for the specified voice in addition to its default language.
For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code
hi-IN.(string)
Possible values:
arbcmn-CNcy-GBda-DKde-DEen-AUen-GBen-GB-WLSen-INen-USes-ESes-MXes-USfr-CAfr-FRis-ISit-ITja-JPhi-INko-KRnb-NOnl-NLpl-PLpt-BRpt-PTro-ROru-RUsv-SEtr-TRen-NZen-ZAca-ESde-ATyue-CNar-AEfi-FIen-IEnl-BEfr-BEcs-CZde-CHen-SGSupportedEngines -> (list)
Specifies which engines (
standard,neural,long-formorgenerative) are supported by a given voice.(string)
Possible values:
standardneurallong-formgenerativeVoiceCreationData -> (structure)
The data from which you created the custom voice.
CreateVoiceandGetVoicereturn this field. The response doesn’t include the audio: a recording that Amazon Polly read from Amazon S3 includes itsS3Url, and a recording that you passed asByteshas no fields inData.Recordings -> (list) [required]
The recordings of the speaker. Each recording specifies its audio format and its audio source.
Constraints:
- min:
1- max:
10(structure)
A recording of the speaker whose voice you want to create. The recording specifies its audio format and its audio source.
Format -> (string) [required]
The audio format of the recording:
wav,flac,ogg_vorbis, ormp3. The format must match the audio data.Possible values:
wavflacogg_vorbismp3Data -> (structure) [required]
The audio source of the recording. Specify either an Amazon S3 object or the audio data.
S3Url -> (string)
The Amazon S3 URL of the audio object, in the form
s3://bucket/key. You needs3:GetObjectpermission on the object.Constraints:
- max:
1024- pattern:
^s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9]/.+$Bytes -> (blob)
The audio data, passed directly in the request. The data must be in the format that
Formatspecifies and can be up to 5 MB. Amazon Polly doesn’t store the audio after it creates the voice, and doesn’t return this field in responses.Constraints:
- max:
5242880CustomerManagedEncryption -> (structure)
The customer managed key that encrypts your custom voice.
CreateVoiceandGetVoicereturn this field if you specified a key inCreateVoice.KmsKeyArn -> (string) [required]
The Amazon Resource Name (ARN) of the key. The key must be a symmetric encryption key in the same Amazon Web Services Region as the voice. To create the voice, you need
kms:DescribeKey,kms:GenerateDataKey, andkms:Decryptpermissions on the key. To synthesize speech with the voice, you needkms:Decryptpermission on the key.Constraints:
- min:
20- max:
2048- pattern:
^arn:aws(-(cn|iso(-b)?|us-gov|eusc))?:kms:[a-z0-9_-]{1,50}:\d{12}:key/[a-zA-Z0-9-]+$EncryptionContext -> (map)
The key-value pairs that Amazon Polly includes as the encryption context when it encrypts or decrypts the voice with the key. You can use these pairs in key policy conditions. Don’t use keys that start with
aws:, which are reserved.Constraints:
- max:
10key -> (string)
Constraints:
- min:
1- max:
128value -> (string)
Constraints:
- min:
1- max:
256CreationTime -> (timestamp)
The date and time when you created the custom voice. Voices that Amazon Polly provides don’t include this field.