Interface PollyClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
Amazon Polly is a web service that makes it easy to synthesize speech from text.
The Amazon Polly service provides API operations for synthesizing high-quality speech from plain text and Speech Synthesis Markup Language (SSML), along with managing pronunciations lexicons that enable you to get the best results for your application domain.
Authenticated API calls must be signed using the Signature Version 4 Signing Process. For more information, see Signing Amazon Web Services API Requests in the IAM User Guide.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic PollyClientBuilderbuilder()Create a builder that can be used to configure and create aPollyClient.static PollyClientcreate()Create aPollyClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CreateVoiceResponsecreateVoice(Consumer<CreateVoiceRequest.Builder> createVoiceRequest) Creates a custom voice from recordings of a speaker and returns it inpendingstatus.default CreateVoiceResponsecreateVoice(CreateVoiceRequest createVoiceRequest) Creates a custom voice from recordings of a speaker and returns it inpendingstatus.default DeleteLexiconResponsedeleteLexicon(Consumer<DeleteLexiconRequest.Builder> deleteLexiconRequest) Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region.default DeleteLexiconResponsedeleteLexicon(DeleteLexiconRequest deleteLexiconRequest) Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region.default DeleteVoiceResponsedeleteVoice(Consumer<DeleteVoiceRequest.Builder> deleteVoiceRequest) Deletes a custom voice.default DeleteVoiceResponsedeleteVoice(DeleteVoiceRequest deleteVoiceRequest) Deletes a custom voice.default DescribeVoicesResponseReturns the list of voices: the voices that Amazon Polly provides and the custom voices in your account.default DescribeVoicesResponsedescribeVoices(Consumer<DescribeVoicesRequest.Builder> describeVoicesRequest) Returns the list of voices: the voices that Amazon Polly provides and the custom voices in your account.default DescribeVoicesResponsedescribeVoices(DescribeVoicesRequest describeVoicesRequest) Returns the list of voices: the voices that Amazon Polly provides and the custom voices in your account.default GetLexiconResponsegetLexicon(Consumer<GetLexiconRequest.Builder> getLexiconRequest) Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region.default GetLexiconResponsegetLexicon(GetLexiconRequest getLexiconRequest) Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region.default GetSpeechSynthesisTaskResponsegetSpeechSynthesisTask(Consumer<GetSpeechSynthesisTaskRequest.Builder> getSpeechSynthesisTaskRequest) Retrieves a specific SpeechSynthesisTask object based on its TaskID.default GetSpeechSynthesisTaskResponsegetSpeechSynthesisTask(GetSpeechSynthesisTaskRequest getSpeechSynthesisTaskRequest) Retrieves a specific SpeechSynthesisTask object based on its TaskID.default GetVoiceResponsegetVoice(Consumer<GetVoiceRequest.Builder> getVoiceRequest) Returns the status and properties of a custom voice.default GetVoiceResponsegetVoice(GetVoiceRequest getVoiceRequest) Returns the status and properties of a custom voice.default ListLexiconsResponseReturns a list of pronunciation lexicons stored in an Amazon Web Services Region.default ListLexiconsResponselistLexicons(Consumer<ListLexiconsRequest.Builder> listLexiconsRequest) Returns a list of pronunciation lexicons stored in an Amazon Web Services Region.default ListLexiconsResponselistLexicons(ListLexiconsRequest listLexiconsRequest) Returns a list of pronunciation lexicons stored in an Amazon Web Services Region.default ListSpeechSynthesisTasksResponseReturns a list of SpeechSynthesisTask objects ordered by their creation date.default ListSpeechSynthesisTasksResponselistSpeechSynthesisTasks(Consumer<ListSpeechSynthesisTasksRequest.Builder> listSpeechSynthesisTasksRequest) Returns a list of SpeechSynthesisTask objects ordered by their creation date.default ListSpeechSynthesisTasksResponselistSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest listSpeechSynthesisTasksRequest) Returns a list of SpeechSynthesisTask objects ordered by their creation date.default ListSpeechSynthesisTasksIterableThis is a variant oflistSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.default ListSpeechSynthesisTasksIterablelistSpeechSynthesisTasksPaginator(Consumer<ListSpeechSynthesisTasksRequest.Builder> listSpeechSynthesisTasksRequest) This is a variant oflistSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.default ListSpeechSynthesisTasksIterablelistSpeechSynthesisTasksPaginator(ListSpeechSynthesisTasksRequest listSpeechSynthesisTasksRequest) This is a variant oflistSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.default ListTagsForResourceResponselistTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) Lists the tags for an Amazon Polly resource.default ListTagsForResourceResponselistTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) Lists the tags for an Amazon Polly resource.default PutLexiconResponseputLexicon(Consumer<PutLexiconRequest.Builder> putLexiconRequest) Stores a pronunciation lexicon in an Amazon Web Services Region.default PutLexiconResponseputLexicon(PutLexiconRequest putLexiconRequest) Stores a pronunciation lexicon in an Amazon Web Services Region.default PollyServiceClientConfigurationThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadatadefault StartSpeechSynthesisTaskResponsestartSpeechSynthesisTask(Consumer<StartSpeechSynthesisTaskRequest.Builder> startSpeechSynthesisTaskRequest) Starts an asynchronous synthesis task by creating a newSpeechSynthesisTask.default StartSpeechSynthesisTaskResponsestartSpeechSynthesisTask(StartSpeechSynthesisTaskRequest startSpeechSynthesisTaskRequest) Starts an asynchronous synthesis task by creating a newSpeechSynthesisTask.synthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default SynthesizeSpeechResponsesynthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest, Path destinationPath) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default <ReturnT> ReturnTsynthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest, ResponseTransformer<SynthesizeSpeechResponse, ReturnT> responseTransformer) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default SynthesizeSpeechResponsesynthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, Path destinationPath) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default <ReturnT> ReturnTsynthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, ResponseTransformer<SynthesizeSpeechResponse, ReturnT> responseTransformer) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default ResponseBytes<SynthesizeSpeechResponse> synthesizeSpeechAsBytes(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default ResponseBytes<SynthesizeSpeechResponse> synthesizeSpeechAsBytes(SynthesizeSpeechRequest synthesizeSpeechRequest) Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.default TagResourceResponsetagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) Adds specified tags to a resource with the specified ARN.default TagResourceResponsetagResource(TagResourceRequest tagResourceRequest) Adds specified tags to a resource with the specified ARN.default UntagResourceResponseuntagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Deletes specified tags from a resource.default UntagResourceResponseuntagResource(UntagResourceRequest untagResourceRequest) Deletes specified tags from a resource.default PollyWaiterwaiter()Create an instance ofPollyWaiterusing this client.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
createVoice
default CreateVoiceResponse createVoice(CreateVoiceRequest createVoiceRequest) throws ValidationException, ServiceFailureException, ServiceQuotaExceededException, AccessDeniedException, TooManyTagsException, InvalidTagParameterException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Creates a custom voice from recordings of a speaker and returns it in
pendingstatus. UseGetVoiceto check the status. When the status isactive, you can use the voice ID inSynthesizeSpeech,StartSpeechSynthesisTask, andStartSpeechSynthesisStream.The
custom-voice-max-countservice quota limits the number of custom voices in your account in each Region. If you reach the quota, the request fails withServiceQuotaExceededException.This operation requires permissions to perform the
polly:CreateVoiceaction. You also needs3:GetObjectpermission on each recording that you specify byS3Url. If you specify a customer managed key, you also needkms:DescribeKey,kms:GenerateDataKey, andkms:Decryptpermissions on the key. If you specifyTags, you also need thepolly:TagResourcepermission.- Parameters:
createVoiceRequest-- Returns:
- Result of the CreateVoice operation returned by the service.
- See Also:
-
createVoice
default CreateVoiceResponse createVoice(Consumer<CreateVoiceRequest.Builder> createVoiceRequest) throws ValidationException, ServiceFailureException, ServiceQuotaExceededException, AccessDeniedException, TooManyTagsException, InvalidTagParameterException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Creates a custom voice from recordings of a speaker and returns it in
pendingstatus. UseGetVoiceto check the status. When the status isactive, you can use the voice ID inSynthesizeSpeech,StartSpeechSynthesisTask, andStartSpeechSynthesisStream.The
custom-voice-max-countservice quota limits the number of custom voices in your account in each Region. If you reach the quota, the request fails withServiceQuotaExceededException.This operation requires permissions to perform the
polly:CreateVoiceaction. You also needs3:GetObjectpermission on each recording that you specify byS3Url. If you specify a customer managed key, you also needkms:DescribeKey,kms:GenerateDataKey, andkms:Decryptpermissions on the key. If you specifyTags, you also need thepolly:TagResourcepermission.
This is a convenience which creates an instance of the
CreateVoiceRequest.Builderavoiding the need to create one manually viaCreateVoiceRequest.builder()- Parameters:
createVoiceRequest- AConsumerthat will call methods onCreateVoiceRequest.Builderto create a request.- Returns:
- Result of the CreateVoice operation returned by the service.
- See Also:
-
deleteLexicon
default DeleteLexiconResponse deleteLexicon(DeleteLexiconRequest deleteLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region. A lexicon which has been deleted is not available for speech synthesis, nor is it possible to retrieve it using either the
GetLexiconorListLexiconAPIs.For more information, see Managing Lexicons.
- Parameters:
deleteLexiconRequest-- Returns:
- Result of the DeleteLexicon operation returned by the service.
- See Also:
-
deleteLexicon
default DeleteLexiconResponse deleteLexicon(Consumer<DeleteLexiconRequest.Builder> deleteLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region. A lexicon which has been deleted is not available for speech synthesis, nor is it possible to retrieve it using either the
GetLexiconorListLexiconAPIs.For more information, see Managing Lexicons.
This is a convenience which creates an instance of the
DeleteLexiconRequest.Builderavoiding the need to create one manually viaDeleteLexiconRequest.builder()- Parameters:
deleteLexiconRequest- AConsumerthat will call methods onDeleteLexiconRequest.Builderto create a request.- Returns:
- Result of the DeleteLexicon operation returned by the service.
- See Also:
-
deleteVoice
default DeleteVoiceResponse deleteVoice(DeleteVoiceRequest deleteVoiceRequest) throws ResourceNotFoundException, ConflictException, ValidationException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Deletes a custom voice.
DescribeVoicesandGetVoicestop returning the voice immediately. You can't restore a deleted voice.You can delete a voice in
activeorfailedstatus. If the voice is inpendingstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException. You can delete the voice even if you disabled its Amazon Web Services KMS key or scheduled it for deletion.This operation requires permissions to perform the
polly:DeleteVoiceaction.- Parameters:
deleteVoiceRequest-- Returns:
- Result of the DeleteVoice operation returned by the service.
- See Also:
-
deleteVoice
default DeleteVoiceResponse deleteVoice(Consumer<DeleteVoiceRequest.Builder> deleteVoiceRequest) throws ResourceNotFoundException, ConflictException, ValidationException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Deletes a custom voice.
DescribeVoicesandGetVoicestop returning the voice immediately. You can't restore a deleted voice.You can delete a voice in
activeorfailedstatus. If the voice is inpendingstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException. You can delete the voice even if you disabled its Amazon Web Services KMS key or scheduled it for deletion.This operation requires permissions to perform the
polly:DeleteVoiceaction.
This is a convenience which creates an instance of the
DeleteVoiceRequest.Builderavoiding the need to create one manually viaDeleteVoiceRequest.builder()- Parameters:
deleteVoiceRequest- AConsumerthat will call methods onDeleteVoiceRequest.Builderto create a request.- Returns:
- Result of the DeleteVoice operation returned by the service.
- See Also:
-
describeVoices
default DescribeVoicesResponse describeVoices(DescribeVoicesRequest describeVoicesRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns the list of voices: the voices that Amazon Polly provides and the custom voices in your account. Each voice speaks a specified language and is identified by an ID. A voice that Amazon Polly provides is either male or female, and its ID is the ASCII version of the voice name.
When synthesizing speech (
SynthesizeSpeech), you provide the voice ID for the voice you want from the list of voices returned byDescribeVoices.For example, your news reader application reads news in a specific language, and you want to give users the option to choose the voice. With the
DescribeVoicesoperation, you can provide a list of available voices for users to choose from.You can optionally specify a language code to filter the available voices. For example, if you specify
en-US, the operation returns a list of all available US English voices.The list includes custom voices in every status. For each voice,
Originindicates whether Amazon Polly provides the voice or you created it. You can use a custom voice for synthesis only when its status isactive. A voice infailedstatus stays in the list until you delete it.For a custom voice,
DescribeVoicesreturnsOrigin,Id,Name,Status,LanguageCode,LanguageName,SupportedEngines, andCreationTime. To getArn,StatusReason,VoiceCreationData, andCustomerManagedEncryption, useGetVoice.The
LanguageCodeandEnginefilters apply to custom voices in the same way as to voices that Amazon Polly provides.This operation requires permissions to perform the
polly:DescribeVoicesaction.- Parameters:
describeVoicesRequest-- Returns:
- Result of the DescribeVoices operation returned by the service.
- See Also:
-
describeVoices
default DescribeVoicesResponse describeVoices(Consumer<DescribeVoicesRequest.Builder> describeVoicesRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns the list of voices: the voices that Amazon Polly provides and the custom voices in your account. Each voice speaks a specified language and is identified by an ID. A voice that Amazon Polly provides is either male or female, and its ID is the ASCII version of the voice name.
When synthesizing speech (
SynthesizeSpeech), you provide the voice ID for the voice you want from the list of voices returned byDescribeVoices.For example, your news reader application reads news in a specific language, and you want to give users the option to choose the voice. With the
DescribeVoicesoperation, you can provide a list of available voices for users to choose from.You can optionally specify a language code to filter the available voices. For example, if you specify
en-US, the operation returns a list of all available US English voices.The list includes custom voices in every status. For each voice,
Originindicates whether Amazon Polly provides the voice or you created it. You can use a custom voice for synthesis only when its status isactive. A voice infailedstatus stays in the list until you delete it.For a custom voice,
DescribeVoicesreturnsOrigin,Id,Name,Status,LanguageCode,LanguageName,SupportedEngines, andCreationTime. To getArn,StatusReason,VoiceCreationData, andCustomerManagedEncryption, useGetVoice.The
LanguageCodeandEnginefilters apply to custom voices in the same way as to voices that Amazon Polly provides.This operation requires permissions to perform the
polly:DescribeVoicesaction.
This is a convenience which creates an instance of the
DescribeVoicesRequest.Builderavoiding the need to create one manually viaDescribeVoicesRequest.builder()- Parameters:
describeVoicesRequest- AConsumerthat will call methods onDescribeVoicesRequest.Builderto create a request.- Returns:
- Result of the DescribeVoices operation returned by the service.
- See Also:
-
describeVoices
default DescribeVoicesResponse describeVoices() throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyExceptionReturns the list of voices: the voices that Amazon Polly provides and the custom voices in your account. Each voice speaks a specified language and is identified by an ID. A voice that Amazon Polly provides is either male or female, and its ID is the ASCII version of the voice name.
When synthesizing speech (
SynthesizeSpeech), you provide the voice ID for the voice you want from the list of voices returned byDescribeVoices.For example, your news reader application reads news in a specific language, and you want to give users the option to choose the voice. With the
DescribeVoicesoperation, you can provide a list of available voices for users to choose from.You can optionally specify a language code to filter the available voices. For example, if you specify
en-US, the operation returns a list of all available US English voices.The list includes custom voices in every status. For each voice,
Originindicates whether Amazon Polly provides the voice or you created it. You can use a custom voice for synthesis only when its status isactive. A voice infailedstatus stays in the list until you delete it.For a custom voice,
DescribeVoicesreturnsOrigin,Id,Name,Status,LanguageCode,LanguageName,SupportedEngines, andCreationTime. To getArn,StatusReason,VoiceCreationData, andCustomerManagedEncryption, useGetVoice.The
LanguageCodeandEnginefilters apply to custom voices in the same way as to voices that Amazon Polly provides.This operation requires permissions to perform the
polly:DescribeVoicesaction.- Returns:
- Result of the DescribeVoices operation returned by the service.
- See Also:
-
getLexicon
default GetLexiconResponse getLexicon(GetLexiconRequest getLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region. For more information, see Managing Lexicons.
- Parameters:
getLexiconRequest-- Returns:
- Result of the GetLexicon operation returned by the service.
- See Also:
-
getLexicon
default GetLexiconResponse getLexicon(Consumer<GetLexiconRequest.Builder> getLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region. For more information, see Managing Lexicons.
This is a convenience which creates an instance of the
GetLexiconRequest.Builderavoiding the need to create one manually viaGetLexiconRequest.builder()- Parameters:
getLexiconRequest- AConsumerthat will call methods onGetLexiconRequest.Builderto create a request.- Returns:
- Result of the GetLexicon operation returned by the service.
- See Also:
-
getSpeechSynthesisTask
default GetSpeechSynthesisTaskResponse getSpeechSynthesisTask(GetSpeechSynthesisTaskRequest getSpeechSynthesisTaskRequest) throws InvalidTaskIdException, ServiceFailureException, SynthesisTaskNotFoundException, AwsServiceException, SdkClientException, PollyException Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.
- Parameters:
getSpeechSynthesisTaskRequest-- Returns:
- Result of the GetSpeechSynthesisTask operation returned by the service.
- See Also:
-
getSpeechSynthesisTask
default GetSpeechSynthesisTaskResponse getSpeechSynthesisTask(Consumer<GetSpeechSynthesisTaskRequest.Builder> getSpeechSynthesisTaskRequest) throws InvalidTaskIdException, ServiceFailureException, SynthesisTaskNotFoundException, AwsServiceException, SdkClientException, PollyException Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.
This is a convenience which creates an instance of the
GetSpeechSynthesisTaskRequest.Builderavoiding the need to create one manually viaGetSpeechSynthesisTaskRequest.builder()- Parameters:
getSpeechSynthesisTaskRequest- AConsumerthat will call methods onGetSpeechSynthesisTaskRequest.Builderto create a request.- Returns:
- Result of the GetSpeechSynthesisTask operation returned by the service.
- See Also:
-
getVoice
default GetVoiceResponse getVoice(GetVoiceRequest getVoiceRequest) throws ResourceNotFoundException, ValidationException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Returns the status and properties of a custom voice. Use this operation after
CreateVoiceto check whether the status of the voice isactiveorfailed. UnlikeDescribeVoices,GetVoicealso returnsArn,VoiceCreationData,CustomerManagedEncryption, andStatusReason. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.This operation requires permissions to perform the
polly:GetVoiceaction.- Parameters:
getVoiceRequest-- Returns:
- Result of the GetVoice operation returned by the service.
- See Also:
-
getVoice
default GetVoiceResponse getVoice(Consumer<GetVoiceRequest.Builder> getVoiceRequest) throws ResourceNotFoundException, ValidationException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Returns the status and properties of a custom voice. Use this operation after
CreateVoiceto check whether the status of the voice isactiveorfailed. UnlikeDescribeVoices,GetVoicealso returnsArn,VoiceCreationData,CustomerManagedEncryption, andStatusReason. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.This operation requires permissions to perform the
polly:GetVoiceaction.
This is a convenience which creates an instance of the
GetVoiceRequest.Builderavoiding the need to create one manually viaGetVoiceRequest.builder()- Parameters:
getVoiceRequest- AConsumerthat will call methods onGetVoiceRequest.Builderto create a request.- Returns:
- Result of the GetVoice operation returned by the service.
- See Also:
-
listLexicons
default ListLexiconsResponse listLexicons(ListLexiconsRequest listLexiconsRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see Managing Lexicons.
- Parameters:
listLexiconsRequest-- Returns:
- Result of the ListLexicons operation returned by the service.
- See Also:
-
listLexicons
default ListLexiconsResponse listLexicons(Consumer<ListLexiconsRequest.Builder> listLexiconsRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see Managing Lexicons.
This is a convenience which creates an instance of the
ListLexiconsRequest.Builderavoiding the need to create one manually viaListLexiconsRequest.builder()- Parameters:
listLexiconsRequest- AConsumerthat will call methods onListLexiconsRequest.Builderto create a request.- Returns:
- Result of the ListLexicons operation returned by the service.
- See Also:
-
listLexicons
default ListLexiconsResponse listLexicons() throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyExceptionReturns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see Managing Lexicons.
- Returns:
- Result of the ListLexicons operation returned by the service.
- See Also:
-
listSpeechSynthesisTasks
default ListSpeechSynthesisTasksResponse listSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest listSpeechSynthesisTasksRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.
- Parameters:
listSpeechSynthesisTasksRequest-- Returns:
- Result of the ListSpeechSynthesisTasks operation returned by the service.
- See Also:
-
listSpeechSynthesisTasks
default ListSpeechSynthesisTasksResponse listSpeechSynthesisTasks(Consumer<ListSpeechSynthesisTasksRequest.Builder> listSpeechSynthesisTasksRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException Returns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.
This is a convenience which creates an instance of the
ListSpeechSynthesisTasksRequest.Builderavoiding the need to create one manually viaListSpeechSynthesisTasksRequest.builder()- Parameters:
listSpeechSynthesisTasksRequest- AConsumerthat will call methods onListSpeechSynthesisTasksRequest.Builderto create a request.- Returns:
- Result of the ListSpeechSynthesisTasks operation returned by the service.
- See Also:
-
listSpeechSynthesisTasks
default ListSpeechSynthesisTasksResponse listSpeechSynthesisTasks() throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyExceptionReturns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.
- Returns:
- Result of the ListSpeechSynthesisTasks operation returned by the service.
- See Also:
-
listSpeechSynthesisTasksPaginator
default ListSpeechSynthesisTasksIterable listSpeechSynthesisTasksPaginator() throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyExceptionThis is a variant of
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client .listSpeechSynthesisTasksPaginator(request); for (software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSpeechSynthesisTasksPaginator
default ListSpeechSynthesisTasksIterable listSpeechSynthesisTasksPaginator(ListSpeechSynthesisTasksRequest listSpeechSynthesisTasksRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException This is a variant of
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client .listSpeechSynthesisTasksPaginator(request); for (software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.- Parameters:
listSpeechSynthesisTasksRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSpeechSynthesisTasksPaginator
default ListSpeechSynthesisTasksIterable listSpeechSynthesisTasksPaginator(Consumer<ListSpeechSynthesisTasksRequest.Builder> listSpeechSynthesisTasksRequest) throws InvalidNextTokenException, ServiceFailureException, AwsServiceException, SdkClientException, PollyException This is a variant of
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client .listSpeechSynthesisTasksPaginator(request); for (software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.polly.paginators.ListSpeechSynthesisTasksIterable responses = client.listSpeechSynthesisTasksPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSpeechSynthesisTasks(software.amazon.awssdk.services.polly.model.ListSpeechSynthesisTasksRequest)operation.
This is a convenience which creates an instance of the
ListSpeechSynthesisTasksRequest.Builderavoiding the need to create one manually viaListSpeechSynthesisTasksRequest.builder()- Parameters:
listSpeechSynthesisTasksRequest- AConsumerthat will call methods onListSpeechSynthesisTasksRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Lists the tags for an Amazon Polly resource.
- Parameters:
listTagsForResourceRequest-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ResourceNotFoundException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Lists the tags for an Amazon Polly resource.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builderavoiding the need to create one manually viaListTagsForResourceRequest.builder()- Parameters:
listTagsForResourceRequest- AConsumerthat will call methods onListTagsForResourceRequest.Builderto create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
putLexicon
default PutLexiconResponse putLexicon(PutLexiconRequest putLexiconRequest) throws InvalidLexiconException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, LexiconSizeExceededException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ValidationException, TooManyTagsException, ServiceFailureException, InvalidTagParameterException, AwsServiceException, SdkClientException, PollyException Stores a pronunciation lexicon in an Amazon Web Services Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.
Overwriting a lexicon keeps its existing tags. You can specify tags only when you create a lexicon. If you specify tags for a lexicon that already exists, the request fails with a
ValidationException. To change the tags of an existing lexicon, useTagResourceandUntagResource.For more information, see Managing Lexicons.
- Parameters:
putLexiconRequest-- Returns:
- Result of the PutLexicon operation returned by the service.
- See Also:
-
putLexicon
default PutLexiconResponse putLexicon(Consumer<PutLexiconRequest.Builder> putLexiconRequest) throws InvalidLexiconException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, LexiconSizeExceededException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ValidationException, TooManyTagsException, ServiceFailureException, InvalidTagParameterException, AwsServiceException, SdkClientException, PollyException Stores a pronunciation lexicon in an Amazon Web Services Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.
Overwriting a lexicon keeps its existing tags. You can specify tags only when you create a lexicon. If you specify tags for a lexicon that already exists, the request fails with a
ValidationException. To change the tags of an existing lexicon, useTagResourceandUntagResource.For more information, see Managing Lexicons.
This is a convenience which creates an instance of the
PutLexiconRequest.Builderavoiding the need to create one manually viaPutLexiconRequest.builder()- Parameters:
putLexiconRequest- AConsumerthat will call methods onPutLexiconRequest.Builderto create a request.- Returns:
- Result of the PutLexicon operation returned by the service.
- See Also:
-
startSpeechSynthesisTask
default StartSpeechSynthesisTaskResponse startSpeechSynthesisTask(StartSpeechSynthesisTaskRequest startSpeechSynthesisTaskRequest) throws TextLengthExceededException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, EngineNotSupportedException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException 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 (OutputS3KeyPrefixandSnsTopicArn). After Amazon Polly creates the synthesis task, the operation returns aSpeechSynthesisTaskobject that includes an identifier for the task and its current status. TheSpeechSynthesisTaskobject is available for 72 hours after you start the asynchronous synthesis task.To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException. If the custom voice uses a customer managed key, you needkms:Decryptpermission on the key. If you disable the key or schedule it for deletion before the task runs, the task fails andTaskStatusReasondescribes the cause.- Parameters:
startSpeechSynthesisTaskRequest-- Returns:
- Result of the StartSpeechSynthesisTask operation returned by the service.
- See Also:
-
startSpeechSynthesisTask
default StartSpeechSynthesisTaskResponse startSpeechSynthesisTask(Consumer<StartSpeechSynthesisTaskRequest.Builder> startSpeechSynthesisTaskRequest) throws TextLengthExceededException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, EngineNotSupportedException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException 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 (OutputS3KeyPrefixandSnsTopicArn). After Amazon Polly creates the synthesis task, the operation returns aSpeechSynthesisTaskobject that includes an identifier for the task and its current status. TheSpeechSynthesisTaskobject is available for 72 hours after you start the asynchronous synthesis task.To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException. If the custom voice uses a customer managed key, you needkms:Decryptpermission on the key. If you disable the key or schedule it for deletion before the task runs, the task fails andTaskStatusReasondescribes the cause.
This is a convenience which creates an instance of the
StartSpeechSynthesisTaskRequest.Builderavoiding the need to create one manually viaStartSpeechSynthesisTaskRequest.builder()- Parameters:
startSpeechSynthesisTaskRequest- AConsumerthat will call methods onStartSpeechSynthesisTaskRequest.Builderto create a request.- Returns:
- Result of the StartSpeechSynthesisTask operation returned by the service.
- See Also:
-
synthesizeSpeech
default <ReturnT> ReturnT synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, ResponseTransformer<SynthesizeSpeechResponse, ReturnT> responseTransformer) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyExceptionSynthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.- Parameters:
synthesizeSpeechRequest-responseTransformer- Functional interface for processing the streamed response content. The unmarshalled SynthesizeSpeechResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformerfor details on implementing this interface and for links to pre-canned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'.- Returns:
- The transformed result of the ResponseTransformer.
- See Also:
-
synthesizeSpeech
default <ReturnT> ReturnT synthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest, ResponseTransformer<SynthesizeSpeechResponse, ReturnT> responseTransformer) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyExceptionSynthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.
This is a convenience which creates an instance of the
SynthesizeSpeechRequest.Builderavoiding the need to create one manually viaSynthesizeSpeechRequest.builder()- Parameters:
synthesizeSpeechRequest- AConsumerthat will call methods onSynthesizeSpeechRequest.Builderto create a request.responseTransformer- Functional interface for processing the streamed response content. The unmarshalled SynthesizeSpeechResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformerfor details on implementing this interface and for links to pre-canned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'.- Returns:
- The transformed result of the ResponseTransformer.
- See Also:
-
synthesizeSpeech
default SynthesizeSpeechResponse synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, Path destinationPath) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.- Parameters:
synthesizeSpeechRequest-destinationPath-Pathto file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'.- Returns:
- The transformed result of the ResponseTransformer.
- See Also:
-
synthesizeSpeech
default SynthesizeSpeechResponse synthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest, Path destinationPath) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.
This is a convenience which creates an instance of the
SynthesizeSpeechRequest.Builderavoiding the need to create one manually viaSynthesizeSpeechRequest.builder()- Parameters:
synthesizeSpeechRequest- AConsumerthat will call methods onSynthesizeSpeechRequest.Builderto create a request.destinationPath-Pathto file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'.- Returns:
- The transformed result of the ResponseTransformer.
- See Also:
-
synthesizeSpeech
default ResponseInputStream<SynthesizeSpeechResponse> synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.- Parameters:
synthesizeSpeechRequest-- Returns:
- A
ResponseInputStreamcontaining data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response(). The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'. - See Also:
-
synthesizeSpeech
default ResponseInputStream<SynthesizeSpeechResponse> synthesizeSpeech(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.
This is a convenience which creates an instance of the
SynthesizeSpeechRequest.Builderavoiding the need to create one manually viaSynthesizeSpeechRequest.builder()- Parameters:
synthesizeSpeechRequest- AConsumerthat will call methods onSynthesizeSpeechRequest.Builderto create a request.- Returns:
- A
ResponseInputStreamcontaining data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response(). The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'. - See Also:
-
synthesizeSpeechAsBytes
default ResponseBytes<SynthesizeSpeechResponse> synthesizeSpeechAsBytes(SynthesizeSpeechRequest synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.- Parameters:
synthesizeSpeechRequest-- Returns:
- A
ResponseBytesthat loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response(). The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'. - See Also:
-
synthesizeSpeechAsBytes
default ResponseBytes<SynthesizeSpeechResponse> synthesizeSpeechAsBytes(Consumer<SynthesizeSpeechRequest.Builder> synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, LanguageNotSupportedException, EngineNotSupportedException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, PollyException Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
To use a custom voice, specify its ID in
VoiceId. The voice must be inactivestatus. If the voice is inpendingorfailedstatus, the request fails withConflictException. If no custom voice with the specified ID exists in your account and Region, the request fails withResourceNotFoundException.If the custom voice uses a customer managed key, you need
kms:Decryptpermission on the key. If you disabled the key or scheduled it for deletion, the request fails withValidationException. If you don't have permission to use the key, the request fails withAccessDeniedException. If Amazon Web Services KMS throttles Amazon Polly's request to use the key, the request fails withThrottlingException.
This is a convenience which creates an instance of the
SynthesizeSpeechRequest.Builderavoiding the need to create one manually viaSynthesizeSpeechRequest.builder()- Parameters:
synthesizeSpeechRequest- AConsumerthat will call methods onSynthesizeSpeechRequest.Builderto create a request.- Returns:
- A
ResponseBytesthat loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response(). The service documentation for the response content is as follows 'Stream containing the synthesized speech.
'. - See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, TooManyTagsException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters. If you specify a tag key that already exists on the resource, the value in the request replaces the existing value.
- Parameters:
tagResourceRequest-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ResourceNotFoundException, TooManyTagsException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters. If you specify a tag key that already exists on the resource, the value in the request replaces the existing value.
This is a convenience which creates an instance of the
TagResourceRequest.Builderavoiding the need to create one manually viaTagResourceRequest.builder()- Parameters:
tagResourceRequest- AConsumerthat will call methods onTagResourceRequest.Builderto create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Deletes specified tags from a resource.
- Parameters:
untagResourceRequest-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ResourceNotFoundException, ValidationException, InvalidTagParameterException, ServiceFailureException, ThrottlingException, AwsServiceException, SdkClientException, PollyException Deletes specified tags from a resource.
This is a convenience which creates an instance of the
UntagResourceRequest.Builderavoiding the need to create one manually viaUntagResourceRequest.builder()- Parameters:
untagResourceRequest- AConsumerthat will call methods onUntagResourceRequest.Builderto create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
waiter
Create an instance ofPollyWaiterusing this client.Waiters created via this method are managed by the SDK and resources will be released when the service client is closed.
- Returns:
- an instance of
PollyWaiter
-
create
Create aPollyClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aPollyClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-