The AWS region to connect to. The region is used to construct
the client endpoint. Defaults to ENV['AWS_REGION'].
Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Aws::Plugins::RegionalEndpoint for more details.

:retry_limit(Integer)
— default:
3
—

The maximum number of times to retry failed requests. Only
~ 500 level server errors and certain ~ 400 level client errors
are retried. Generally, these are throttling errors, data
checksum errors, networking errors, timeout errors and auth
errors from expired credentials. See Aws::Plugins::RetryErrors for more details.

Causes the client to return stubbed responses. By default
fake responses are generated and returned. You can specify
the response data to return or errors to raise by calling
ClientStubs#stub_responses. See ClientStubs for more information.

Please note When response stubbing is enabled, no HTTP
requests are made, and retries are disabled. See Aws::Plugins::StubResponses for more details.

Instance Method Details

#delete_lexicon(options = {}) ⇒ Struct

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.

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.

Examples:

Example: To describe available voices

# Returns the list of voices that are available for use when requesting speech synthesis. Displayed languages are those within the specified language code. If no language code is specified, voices for all available languages are displayed.
resp=client.describe_voices({language_code:"en-GB",})# resp.to_h outputs the following:
{voices:[{gender:"Female",id:"Emma",language_code:"en-GB",language_name:"British English",name:"Emma",},{gender:"Male",id:"Brian",language_code:"en-GB",language_name:"British English",name:"Brian",},{gender:"Female",id:"Amy",language_code:"en-GB",language_name:"British English",name:"Amy",},],}

The language identification tag (ISO 639 code for the language name-ISO
3166 country code) for filtering the list of voices returned. If you
don\'t specify this optional parameter, all available voices are
returned.

:next_token(String)
—

An opaque pagination token returned from the previous DescribeVoices
operation. If present, this indicates where to continue the listing.

#put_lexicon(options = {}) ⇒ Struct

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.

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.

Examples:

Example: To synthesize speech

# Synthesizes plain text or SSML into a file of human-like speech.
resp=client.synthesize_speech({lexicon_names:["example",],output_format:"mp3",sample_rate:"8000",text:"All Gaul is divided into three parts",text_type:"text",voice_id:"Joanna",})# resp.to_h outputs the following:
{audio_stream:"TEXT",content_type:"audio/mpeg",request_characters:37,}

Specifies where to stream response data. You can provide the path where a file will be created on disk, or you can provide an IO object. If omitted, the response data will be loaded into memory and written to a StringIO object.

:lexicon_names(Array<String>)
—

List of one or more pronunciation lexicon names you want the service to
apply during synthesis. Lexicons are applied only if the language of the
lexicon is the same as the language of the voice. For information about
storing lexicons, see PutLexicon.

:output_format(required, String)
—

The format in which the returned output will be encoded. For audio
stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this
will be json.

:sample_rate(String)
—

The audio frequency specified in Hz.

The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and
\"22050\". The default value is \"22050\".

Valid values for pcm are \"8000\" and \"16000\" The default value is
\"16000\".

:speech_mark_types(Array<String>)
—

The type of speech marks returned for the input text.

:text(required, String)
—

Input text to synthesize. If you specify ssml as the TextType,
follow the SSML format for the input text.

:text_type(String)
—

Specifies whether the input text is plain text or SSML. The default
value is plain text. For more information, see Using SSML.

:voice_id(required, String)
—

Voice ID to use for the synthesis. You can get a list of available voice
IDs by calling the DescribeVoices operation.