PollyClient
Auto-generated documentation for Polly type annotations stubs module types-aiobotocore-polly.
PollyClient
Type annotations and code completion for session.client("polly")
boto3 documentation
from aioboto3.session import Session
from types_aiobotocore_polly.client import PollyClient
session = Session()
async with session.client("polly") as client:
client: PollyClient
Exceptions
aioboto3
client exceptions are generated in runtime.
This class provides code completion for session.client("polly").exceptions
structure.
async with session.client("polly") as client:
try:
do_something(client)
except (
client.ClientError,
client.EngineNotSupportedException,
client.InvalidLexiconException,
client.InvalidNextTokenException,
client.InvalidS3BucketException,
client.InvalidS3KeyException,
client.InvalidSampleRateException,
client.InvalidSnsTopicArnException,
client.InvalidSsmlException,
client.InvalidTaskIdException,
client.LanguageNotSupportedException,
client.LexiconNotFoundException,
client.LexiconSizeExceededException,
client.MarksNotSupportedForFormatException,
client.MaxLexemeLengthExceededException,
client.MaxLexiconsNumberExceededException,
client.ServiceFailureException,
client.SsmlMarksNotSupportedForTextTypeException,
client.SynthesisTaskNotFoundException,
client.TextLengthExceededException,
client.UnsupportedPlsAlphabetException,
client.UnsupportedPlsLanguageException,
) as e:
print(e)
from types_aiobotocore_polly.client import Exceptions
def handle_error(exc: Exceptions.ClientError) -> None:
...
Methods
can_paginate
Check if an operation can be paginated.
Type annotations and code completion for session.client("polly").can_paginate
method.
boto3 documentation
close
Closes underlying endpoint connections.
Type annotations and code completion for session.client("polly").close
method.
boto3 documentation
delete_lexicon
Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region.
Type annotations and code completion for session.client("polly").delete_lexicon
method.
boto3 documentation
kwargs: DeleteLexiconInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.delete_lexicon(**kwargs)
describe_voices
Returns the list of voices that are available for use when requesting speech synthesis.
Type annotations and code completion for session.client("polly").describe_voices
method.
boto3 documentation
await def describe_voices(
self,
*,
Engine: EngineType = ..., # (1)
LanguageCode: LanguageCodeType = ..., # (2)
IncludeAdditionalLanguageCodes: bool = ...,
NextToken: str = ...,
) -> DescribeVoicesOutputTypeDef: # (3)
...
- See EngineType
- See LanguageCodeType
- See DescribeVoicesOutputTypeDef
kwargs: DescribeVoicesInputRequestTypeDef = { # (1)
"Engine": ...,
}
parent.describe_voices(**kwargs)
generate_presigned_url
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for session.client("polly").generate_presigned_url
method.
boto3 documentation
await def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_lexicon
Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region.
Type annotations and code completion for session.client("polly").get_lexicon
method.
boto3 documentation
kwargs: GetLexiconInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.get_lexicon(**kwargs)
get_speech_synthesis_task
Retrieves a specific SpeechSynthesisTask object based on its TaskID.
Type annotations and code completion for session.client("polly").get_speech_synthesis_task
method.
boto3 documentation
await def get_speech_synthesis_task(
self,
*,
TaskId: str,
) -> GetSpeechSynthesisTaskOutputTypeDef: # (1)
...
kwargs: GetSpeechSynthesisTaskInputRequestTypeDef = { # (1)
"TaskId": ...,
}
parent.get_speech_synthesis_task(**kwargs)
list_lexicons
Returns a list of pronunciation lexicons stored in an Amazon Web Services Region.
Type annotations and code completion for session.client("polly").list_lexicons
method.
boto3 documentation
await def list_lexicons(
self,
*,
NextToken: str = ...,
) -> ListLexiconsOutputTypeDef: # (1)
...
kwargs: ListLexiconsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_lexicons(**kwargs)
list_speech_synthesis_tasks
Returns a list of SpeechSynthesisTask objects ordered by their creation date.
Type annotations and code completion for session.client("polly").list_speech_synthesis_tasks
method.
boto3 documentation
await def list_speech_synthesis_tasks(
self,
*,
MaxResults: int = ...,
NextToken: str = ...,
Status: TaskStatusType = ..., # (1)
) -> ListSpeechSynthesisTasksOutputTypeDef: # (2)
...
kwargs: ListSpeechSynthesisTasksInputRequestTypeDef = { # (1)
"MaxResults": ...,
}
parent.list_speech_synthesis_tasks(**kwargs)
put_lexicon
Stores a pronunciation lexicon in an Amazon Web Services Region.
Type annotations and code completion for session.client("polly").put_lexicon
method.
boto3 documentation
kwargs: PutLexiconInputRequestTypeDef = { # (1)
"Name": ...,
"Content": ...,
}
parent.put_lexicon(**kwargs)
start_speech_synthesis_task
Allows the creation of an asynchronous synthesis task, by starting a new
SpeechSynthesisTask
.
Type annotations and code completion for session.client("polly").start_speech_synthesis_task
method.
boto3 documentation
await def start_speech_synthesis_task(
self,
*,
OutputFormat: OutputFormatType, # (1)
OutputS3BucketName: str,
Text: str,
VoiceId: VoiceIdType, # (2)
Engine: EngineType = ..., # (3)
LanguageCode: LanguageCodeType = ..., # (4)
LexiconNames: Sequence[str] = ...,
OutputS3KeyPrefix: str = ...,
SampleRate: str = ...,
SnsTopicArn: str = ...,
SpeechMarkTypes: Sequence[SpeechMarkTypeType] = ..., # (5)
TextType: TextTypeType = ..., # (6)
) -> StartSpeechSynthesisTaskOutputTypeDef: # (7)
...
- See OutputFormatType
- See VoiceIdType
- See EngineType
- See LanguageCodeType
- See SpeechMarkTypeType
- See TextTypeType
- See StartSpeechSynthesisTaskOutputTypeDef
kwargs: StartSpeechSynthesisTaskInputRequestTypeDef = { # (1)
"OutputFormat": ...,
"OutputS3BucketName": ...,
"Text": ...,
"VoiceId": ...,
}
parent.start_speech_synthesis_task(**kwargs)
synthesize_speech
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
Type annotations and code completion for session.client("polly").synthesize_speech
method.
boto3 documentation
await def synthesize_speech(
self,
*,
OutputFormat: OutputFormatType, # (1)
Text: str,
VoiceId: VoiceIdType, # (2)
Engine: EngineType = ..., # (3)
LanguageCode: LanguageCodeType = ..., # (4)
LexiconNames: Sequence[str] = ...,
SampleRate: str = ...,
SpeechMarkTypes: Sequence[SpeechMarkTypeType] = ..., # (5)
TextType: TextTypeType = ..., # (6)
) -> SynthesizeSpeechOutputTypeDef: # (7)
...
- See OutputFormatType
- See VoiceIdType
- See EngineType
- See LanguageCodeType
- See SpeechMarkTypeType
- See TextTypeType
- See SynthesizeSpeechOutputTypeDef
kwargs: SynthesizeSpeechInputRequestTypeDef = { # (1)
"OutputFormat": ...,
"Text": ...,
"VoiceId": ...,
}
parent.synthesize_speech(**kwargs)
__aenter__
Type annotations and code completion for session.client("polly").__aenter__
method.
boto3 documentation
__aexit__
Type annotations and code completion for session.client("polly").__aexit__
method.
boto3 documentation
get_paginator
Type annotations and code completion for session.client("polly").get_paginator
method with overloads.
client.get_paginator("describe_voices")
-> DescribeVoicesPaginatorclient.get_paginator("list_lexicons")
-> ListLexiconsPaginatorclient.get_paginator("list_speech_synthesis_tasks")
-> ListSpeechSynthesisTasksPaginator