AutoCloseable
@Generated("software.amazon.awssdk:codegen") public interface PollyAsyncClient extends AutoCloseable
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.
Modifier and Type | Method | Description |
---|---|---|
static PollyAsyncClientBuilder |
builder() |
Create a builder that can be used to configure and create a
PollyAsyncClient . |
static PollyAsyncClient |
create() |
Create a
PollyAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default CompletableFuture<DeleteLexiconResponse> |
deleteLexicon(DeleteLexiconRequest deleteLexiconRequest) |
Deletes the specified pronunciation lexicon stored in an AWS Region.
|
default CompletableFuture<DescribeVoicesResponse> |
describeVoices(DescribeVoicesRequest describeVoicesRequest) |
Returns the list of voices that are available for use when requesting speech synthesis.
|
default CompletableFuture<GetLexiconResponse> |
getLexicon(GetLexiconRequest getLexiconRequest) |
Returns the content of the specified pronunciation lexicon stored in an AWS Region.
|
default CompletableFuture<ListLexiconsResponse> |
listLexicons(ListLexiconsRequest listLexiconsRequest) |
Returns a list of pronunciation lexicons stored in an AWS Region.
|
default CompletableFuture<PutLexiconResponse> |
putLexicon(PutLexiconRequest putLexiconRequest) |
Stores a pronunciation lexicon in an AWS Region.
|
default <ReturnT> CompletableFuture<ReturnT> |
synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest,
AsyncResponseHandler<SynthesizeSpeechResponse,ReturnT> asyncResponseHandler) |
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
close
static PollyAsyncClient create()
PollyAsyncClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static PollyAsyncClientBuilder builder()
PollyAsyncClient
.default CompletableFuture<DeleteLexiconResponse> deleteLexicon(DeleteLexiconRequest deleteLexiconRequest)
Deletes the specified pronunciation lexicon stored in an AWS Region. A lexicon which has been deleted is not
available for speech synthesis, nor is it possible to retrieve it using either the GetLexicon
or
ListLexicon
APIs.
For more information, see Managing Lexicons.
deleteLexiconRequest
- Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
default CompletableFuture<DescribeVoicesResponse> describeVoices(DescribeVoicesRequest describeVoicesRequest)
Returns the list of voices that are available for use when requesting speech synthesis. Each voice speaks a specified language, is either male or female, and is identified by an ID, which 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 by DescribeVoices
.
For example, you want your news reader application to read news in a specific language, but giving a user the
option to choose the voice. Using the DescribeVoices
operation you can provide the user with a list
of available voices to select 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.
This operation requires permissions to perform the polly:DescribeVoices
action.
describeVoicesRequest
- default CompletableFuture<GetLexiconResponse> getLexicon(GetLexiconRequest getLexiconRequest)
Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see Managing Lexicons.
getLexiconRequest
- Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
default CompletableFuture<ListLexiconsResponse> listLexicons(ListLexiconsRequest listLexiconsRequest)
Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.
listLexiconsRequest
- default CompletableFuture<PutLexiconResponse> putLexicon(PutLexiconRequest putLexiconRequest)
Stores a pronunciation lexicon in an AWS 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.
For more information, see Managing Lexicons.
putLexiconRequest
- x-sampa
and ipa
.default <ReturnT> CompletableFuture<ReturnT> synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, AsyncResponseHandler<SynthesizeSpeechResponse,ReturnT> asyncResponseHandler)
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.
synthesizeSpeechRequest
- asyncResponseHandler
- The response handler for processing the streaming response in a non-blocking manner. See
AsyncResponseHandler
for details on how this callback should be implemented and for links to
precanned implementations for common scenarios like downloading to a file. The service documentation for
the streamed content is as follows '
Stream containing the synthesized speech.
'.Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
OutputFormat
selected. Speech marks are only available for content in json
format.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.