Skip to content

PollyClient.create_voice

rboto-polly==0.4.0 · Service index · Types

Model summary (excerpt): 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...

Install and imports

python -m pip install "rboto[polly]==0.4.0"
from rboto import PollyClient
from rboto_polly.types import (
    CreateVoiceOutput,
    CustomVoiceLanguageCode,
    CustomerManagedEncryption,
    VoiceCreationData,
)

Signature

async def create_voice(
    *,
    name: str,
    language_code: CustomVoiceLanguageCode,
    terms_accepted: bool,
    voice_creation_data: VoiceCreationData,
    customer_managed_encryption: CustomerManagedEncryption | None = None,
    tags: dict[str, str] | None = None,
    client_token: str | None = None,
) -> CreateVoiceOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
name Yes 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.
language_code Yes The language of the recordings, for example, en-US . Amazon Polly doesn't detect the language from the recordings.
terms_accepted Yes 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...
voice_creation_data Yes The recordings that Amazon Polly uses to create the voice.
customer_managed_encryption No 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.
tags No 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.
client_token No 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.

Output

CreateVoiceOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
voice VoiceOutput | None Always present VoiceOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

CreateVoiceOutput, CustomVoiceLanguageCode, CustomerManagedEncryption, VoiceCreationData

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_polly.exceptions:

AccessDeniedError, InvalidTagParameterError, ServiceFailureError, ServiceQuotaExceededError, ThrottlingError, TooManyTagsError, ValidationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model