Skip to content

PollyClient.start_speech_synthesis_task

rboto-polly==0.4.0 · Service index · Types

Model summary (excerpt): Starts an asynchronous synthesis task by creating a new SpeechSynthesisTask . This operation requires all the standard information needed for speech synthesis, plus the name of an Amazon S3 bucket for the service to store the output of the synthesis task and two optional parameters ( OutputS3KeyPrefix and SnsTopicArn ). After Amazon Polly creates the synthesis task, the operation returns a...

Install and imports

python -m pip install "rboto[polly]==0.4.0"
from rboto import PollyClient
from collections.abc import Sequence
from rboto_polly.types import (
    Engine,
    LanguageCode,
    OutputFormat,
    SpeechMarkType,
    StartSpeechSynthesisTaskOutput,
    TextType,
    VoiceId,
)

Signature

async def start_speech_synthesis_task(
    *,
    output_format: OutputFormat,
    output_s3_bucket_name: str,
    text: str,
    voice_id: VoiceId,
    engine: Engine | None = None,
    language_code: LanguageCode | None = None,
    lexicon_names: Sequence[str] | None = None,
    output_s3_key_prefix: str | None = None,
    sample_rate: str | None = None,
    sns_topic_arn: str | None = None,
    speech_mark_types: Sequence[SpeechMarkType] | None = None,
    text_type: TextType | None = None,
) -> StartSpeechSynthesisTaskOutput: ...

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)
output_format Yes The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law, or pcm. For speech marks, this will be json.
output_s3_bucket_name Yes Amazon S3 bucket name to which the output file will be saved.
text Yes The input text to synthesize. If you specify ssml as the TextType, follow the SSML format for the input text.
voice_id Yes The voice ID to use for the synthesis. To use a custom voice, specify the voice ID that CreateVoice returned, for example, vc-9a8fa85dd3 . You can't specify the ARN of a voice.
engine No Specifies the engine ( standard , neural , long-form or generative ) for Amazon Polly to use when processing input text for speech synthesis. Using a voice that is not supported for the engine selected will result in an error.
language_code No Optional language code for the Speech Synthesis request. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). If a bilingual voice is used and no language code is specified, Amazon Polly uses the default language of the bilingual voice. The default language for any voice is the one returned by the DescribeVoices...
lexicon_names No List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice.
output_s3_key_prefix No The Amazon S3 key prefix for the output speech file.
sample_rate No The audio frequency specified in Hz. The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000". The default value for generative voices is "24000". Valid values for pcm are "8000" and "16000" The default value is "16000"....
sns_topic_arn No ARN for the SNS topic optionally used for providing status notification for a speech synthesis task.
speech_mark_types No The type of speech marks returned for the input text.
text_type No Specifies whether the input text is plain text or SSML. The default value is plain text.

Output

StartSpeechSynthesisTaskOutput.

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
synthesis_task SynthesisTaskOutput | None Always present SynthesisTaskOutput

| 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.

Engine, LanguageCode, OutputFormat, SpeechMarkType, StartSpeechSynthesisTaskOutput, TextType, VoiceId

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:

ConflictError, EngineNotSupportedError, InvalidS3BucketError, InvalidS3KeyError, InvalidSampleRateError, InvalidSnsTopicArnError, InvalidSsmlError, LanguageNotSupportedError, LexiconNotFoundError, MarksNotSupportedForFormatError, ResourceNotFoundError, ServiceFailureError, SsmlMarksNotSupportedForTextTypeError, TextLengthExceededError.

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

Service guide · Pinned model