@Generated(value="software.amazon.awssdk:codegen") public interface PollyClient extends SdkClient, SdkAutoCloseable
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 | Field and Description |
---|---|
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static PollyClientBuilder |
builder()
Create a builder that can be used to configure and create a
PollyClient . |
static PollyClient |
create()
Create a
PollyClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from
the DefaultCredentialsProvider . |
default DeleteLexiconResponse |
deleteLexicon(Consumer<DeleteLexiconRequest.Builder> deleteLexiconRequest)
Deletes the specified pronunciation lexicon stored in an AWS Region.
|
default DeleteLexiconResponse |
deleteLexicon(DeleteLexiconRequest deleteLexiconRequest)
Deletes the specified pronunciation lexicon stored in an AWS Region.
|
default DescribeVoicesResponse |
describeVoices()
Returns the list of voices that are available for use when requesting speech synthesis.
|
default DescribeVoicesResponse |
describeVoices(Consumer<DescribeVoicesRequest.Builder> describeVoicesRequest)
Returns the list of voices that are available for use when requesting speech synthesis.
|
default DescribeVoicesResponse |
describeVoices(DescribeVoicesRequest describeVoicesRequest)
Returns the list of voices that are available for use when requesting speech synthesis.
|
default GetLexiconResponse |
getLexicon(Consumer<GetLexiconRequest.Builder> getLexiconRequest)
Returns the content of the specified pronunciation lexicon stored in an AWS Region.
|
default GetLexiconResponse |
getLexicon(GetLexiconRequest getLexiconRequest)
Returns the content of the specified pronunciation lexicon stored in an AWS Region.
|
default ListLexiconsResponse |
listLexicons()
Returns a list of pronunciation lexicons stored in an AWS Region.
|
default ListLexiconsResponse |
listLexicons(Consumer<ListLexiconsRequest.Builder> listLexiconsRequest)
Returns a list of pronunciation lexicons stored in an AWS Region.
|
default ListLexiconsResponse |
listLexicons(ListLexiconsRequest listLexiconsRequest)
Returns a list of pronunciation lexicons stored in an AWS Region.
|
default PutLexiconResponse |
putLexicon(Consumer<PutLexiconRequest.Builder> putLexiconRequest)
Stores a pronunciation lexicon in an AWS Region.
|
default PutLexiconResponse |
putLexicon(PutLexiconRequest putLexiconRequest)
Stores a pronunciation lexicon in an AWS Region.
|
static ServiceMetadata |
serviceMetadata() |
default ResponseInputStream<SynthesizeSpeechResponse> |
synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest)
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
default SynthesizeSpeechResponse |
synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest,
Path filePath)
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
default <ReturnT> ReturnT |
synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest,
StreamingResponseHandler<SynthesizeSpeechResponse,ReturnT> streamingResponseHandler)
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
default ResponseBytes<SynthesizeSpeechResponse> |
synthesizeSpeechBytes(SynthesizeSpeechRequest synthesizeSpeechRequest)
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
serviceName
close
static final String SERVICE_NAME
static PollyClient create()
PollyClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from
the DefaultCredentialsProvider
.static PollyClientBuilder builder()
PollyClient
.default DeleteLexiconResponse deleteLexicon(DeleteLexiconRequest deleteLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default DeleteLexiconResponse deleteLexicon(Consumer<DeleteLexiconRequest.Builder> deleteLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default DescribeVoicesResponse describeVoices() throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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.
InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
describeVoices(DescribeVoicesRequest)
,
AWS API
Documentationdefault DescribeVoicesResponse describeVoices(DescribeVoicesRequest describeVoicesRequest) throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default DescribeVoicesResponse describeVoices(Consumer<DescribeVoicesRequest.Builder> describeVoicesRequest) throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetLexiconResponse getLexicon(GetLexiconRequest getLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see Managing Lexicons.
getLexiconRequest
- LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetLexiconResponse getLexicon(Consumer<GetLexiconRequest.Builder> getLexiconRequest) throws LexiconNotFoundException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see Managing Lexicons.
getLexiconRequest
- LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default ListLexiconsResponse listLexicons() throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.
InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
listLexicons(ListLexiconsRequest)
,
AWS API
Documentationdefault ListLexiconsResponse listLexicons(ListLexiconsRequest listLexiconsRequest) throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.
listLexiconsRequest
- InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default ListLexiconsResponse listLexicons(Consumer<ListLexiconsRequest.Builder> listLexiconsRequest) throws InvalidNextTokenException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.
listLexiconsRequest
- InvalidNextTokenException
- The NextToken is invalid. Verify that it's spelled correctly, and then try again.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default PutLexiconResponse putLexicon(PutLexiconRequest putLexiconRequest) throws InvalidLexiconException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, LexiconSizeExceededException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- InvalidLexiconException
- Amazon Polly can't find the specified lexicon. Verify that the lexicon's name is spelled correctly, and
then try again.UnsupportedPlsAlphabetException
- The alphabet specified by the lexicon is not a supported alphabet. Valid values are x-sampa
and ipa
.UnsupportedPlsLanguageException
- The language specified in the lexicon is unsupported. For a list of supported languages, see Lexicon Attributes.LexiconSizeExceededException
- The maximum size of the specified lexicon would be exceeded by this operation.MaxLexemeLengthExceededException
- The maximum size of the lexeme would be exceeded by this operation.MaxLexiconsNumberExceededException
- The maximum number of lexicons would be exceeded by this operation.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default PutLexiconResponse putLexicon(Consumer<PutLexiconRequest.Builder> putLexiconRequest) throws InvalidLexiconException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, LexiconSizeExceededException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ServiceFailureException, SdkServiceException, SdkClientException, PollyException
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
- InvalidLexiconException
- Amazon Polly can't find the specified lexicon. Verify that the lexicon's name is spelled correctly, and
then try again.UnsupportedPlsAlphabetException
- The alphabet specified by the lexicon is not a supported alphabet. Valid values are x-sampa
and ipa
.UnsupportedPlsLanguageException
- The language specified in the lexicon is unsupported. For a list of supported languages, see Lexicon Attributes.LexiconSizeExceededException
- The maximum size of the specified lexicon would be exceeded by this operation.MaxLexemeLengthExceededException
- The maximum size of the lexeme would be exceeded by this operation.MaxLexiconsNumberExceededException
- The maximum number of lexicons would be exceeded by this operation.ServiceFailureException
- An unknown condition has caused a service failure.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default <ReturnT> ReturnT synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, StreamingResponseHandler<SynthesizeSpeechResponse,ReturnT> streamingResponseHandler) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, SdkServiceException, 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.
synthesizeSpeechRequest
- streamingHandler
- 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. See
StreamingResponseHandler
for 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.
'.TextLengthExceededException
- The value of the "Text" parameter is longer than the accepted limits. The limit for input text is a
maximum of 3000 characters total, of which no more than 1500 can be billed characters. SSML tags are not
counted as billed characters.InvalidSampleRateException
- The specified sample rate is not valid.InvalidSsmlException
- The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try
again.LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.MarksNotSupportedForFormatException
- Speech marks are not supported for the OutputFormat
selected. Speech marks are only
available for content in json
format.SsmlMarksNotSupportedForTextTypeException
- SSML speech marks are not supported for plain text-type input.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default SynthesizeSpeechResponse synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest, Path filePath) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, SdkServiceException, 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.
synthesizeSpeechRequest
- path
- Path
to 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.
'.TextLengthExceededException
- The value of the "Text" parameter is longer than the accepted limits. The limit for input text is a
maximum of 3000 characters total, of which no more than 1500 can be billed characters. SSML tags are not
counted as billed characters.InvalidSampleRateException
- The specified sample rate is not valid.InvalidSsmlException
- The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try
again.LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.MarksNotSupportedForFormatException
- Speech marks are not supported for the OutputFormat
selected. Speech marks are only
available for content in json
format.SsmlMarksNotSupportedForTextTypeException
- SSML speech marks are not supported for plain text-type input.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
synthesizeSpeech(SynthesizeSpeechRequest, StreamingResponseHandler)
,
AWS API
Documentationdefault ResponseInputStream<SynthesizeSpeechResponse> synthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, SdkServiceException, 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.
synthesizeSpeechRequest
- ResponseInputStream
containing 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 via
ResponseInputStream.response()
. The service documentation for the response content is as follows
'
Stream containing the synthesized speech.
'.TextLengthExceededException
- The value of the "Text" parameter is longer than the accepted limits. The limit for input text is a
maximum of 3000 characters total, of which no more than 1500 can be billed characters. SSML tags are not
counted as billed characters.InvalidSampleRateException
- The specified sample rate is not valid.InvalidSsmlException
- The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try
again.LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.MarksNotSupportedForFormatException
- Speech marks are not supported for the OutputFormat
selected. Speech marks are only
available for content in json
format.SsmlMarksNotSupportedForTextTypeException
- SSML speech marks are not supported for plain text-type input.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
#getObject(synthesizeSpeech, StreamingResponseHandler)
,
AWS API
Documentationdefault ResponseBytes<SynthesizeSpeechResponse> synthesizeSpeechBytes(SynthesizeSpeechRequest synthesizeSpeechRequest) throws TextLengthExceededException, InvalidSampleRateException, InvalidSsmlException, LexiconNotFoundException, ServiceFailureException, MarksNotSupportedForFormatException, SsmlMarksNotSupportedForTextTypeException, SdkServiceException, 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.
synthesizeSpeechRequest
- ResponseBytes
that 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 via ResponseBytes.response()
. The service documentation for the response content is
as follows '
Stream containing the synthesized speech.
'.TextLengthExceededException
- The value of the "Text" parameter is longer than the accepted limits. The limit for input text is a
maximum of 3000 characters total, of which no more than 1500 can be billed characters. SSML tags are not
counted as billed characters.InvalidSampleRateException
- The specified sample rate is not valid.InvalidSsmlException
- The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try
again.LexiconNotFoundException
- Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its
name is misspelled or specifying a lexicon that is in a different region.
Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.
ServiceFailureException
- An unknown condition has caused a service failure.MarksNotSupportedForFormatException
- Speech marks are not supported for the OutputFormat
selected. Speech marks are only
available for content in json
format.SsmlMarksNotSupportedForTextTypeException
- SSML speech marks are not supported for plain text-type input.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.PollyException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
#getObject(synthesizeSpeech, StreamingResponseHandler)
,
AWS API
Documentationstatic ServiceMetadata serviceMetadata()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.