Class: Aws::Polly::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Polly::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-polly/client.rb
Overview
An API client for Polly. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::Polly::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#delete_lexicon(params = {}) ⇒ Struct
Deletes the specified pronunciation lexicon stored in an Amazon Web Services Region.
-
#describe_voices(params = {}) ⇒ Types::DescribeVoicesOutput
Returns the list of voices that are available for use when requesting speech synthesis.
-
#get_lexicon(params = {}) ⇒ Types::GetLexiconOutput
Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region.
-
#get_speech_synthesis_task(params = {}) ⇒ Types::GetSpeechSynthesisTaskOutput
Retrieves a specific SpeechSynthesisTask object based on its TaskID.
-
#list_lexicons(params = {}) ⇒ Types::ListLexiconsOutput
Returns a list of pronunciation lexicons stored in an Amazon Web Services Region.
-
#list_speech_synthesis_tasks(params = {}) ⇒ Types::ListSpeechSynthesisTasksOutput
Returns a list of SpeechSynthesisTask objects ordered by their creation date.
-
#put_lexicon(params = {}) ⇒ Struct
Stores a pronunciation lexicon in an Amazon Web Services Region.
-
#start_speech_synthesis_task(params = {}) ⇒ Types::StartSpeechSynthesisTaskOutput
Allows the creation of an asynchronous synthesis task, by starting a new ‘SpeechSynthesisTask`.
-
#synthesize_speech(params = {}) ⇒ Types::SynthesizeSpeechOutput
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
444 445 446 |
# File 'lib/aws-sdk-polly/client.rb', line 444 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1225 1226 1227 |
# File 'lib/aws-sdk-polly/client.rb', line 1225 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1228 1229 1230 |
# File 'lib/aws-sdk-polly/client.rb', line 1228 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 |
# File 'lib/aws-sdk-polly/client.rb', line 1198 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Polly') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-polly' context[:gem_version] = '1.100.0' Seahorse::Client::Request.new(handlers, context) end |
#delete_lexicon(params = {}) ⇒ Struct
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 ‘GetLexicon` or `ListLexicon` APIs.
For more information, see [Managing Lexicons].
[1]: docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
490 491 492 493 |
# File 'lib/aws-sdk-polly/client.rb', line 490 def delete_lexicon(params = {}, = {}) req = build_request(:delete_lexicon, params) req.send_request() end |
#describe_voices(params = {}) ⇒ Types::DescribeVoicesOutput
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.
608 609 610 611 |
# File 'lib/aws-sdk-polly/client.rb', line 608 def describe_voices(params = {}, = {}) req = build_request(:describe_voices, params) req.send_request() end |
#get_lexicon(params = {}) ⇒ Types::GetLexiconOutput
Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region. For more information, see [Managing Lexicons].
[1]: docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
675 676 677 678 |
# File 'lib/aws-sdk-polly/client.rb', line 675 def get_lexicon(params = {}, = {}) req = build_request(:get_lexicon, params) req.send_request() end |
#get_speech_synthesis_task(params = {}) ⇒ Types::GetSpeechSynthesisTaskOutput
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.
722 723 724 725 |
# File 'lib/aws-sdk-polly/client.rb', line 722 def get_speech_synthesis_task(params = {}, = {}) req = build_request(:get_speech_synthesis_task, params) req.send_request() end |
#list_lexicons(params = {}) ⇒ Types::ListLexiconsOutput
Returns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see [Managing Lexicons].
[1]: docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
791 792 793 794 |
# File 'lib/aws-sdk-polly/client.rb', line 791 def list_lexicons(params = {}, = {}) req = build_request(:list_lexicons, params) req.send_request() end |
#list_speech_synthesis_tasks(params = {}) ⇒ Types::ListSpeechSynthesisTasksOutput
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.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
851 852 853 854 |
# File 'lib/aws-sdk-polly/client.rb', line 851 def list_speech_synthesis_tasks(params = {}, = {}) req = build_request(:list_speech_synthesis_tasks, params) req.send_request() end |
#put_lexicon(params = {}) ⇒ Struct
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.
For more information, see [Managing Lexicons].
[1]: docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
903 904 905 906 |
# File 'lib/aws-sdk-polly/client.rb', line 903 def put_lexicon(params = {}, = {}) req = build_request(:put_lexicon, params) req.send_request() end |
#start_speech_synthesis_task(params = {}) ⇒ Types::StartSpeechSynthesisTaskOutput
Allows the creation of an asynchronous synthesis task, by starting 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 (`OutputS3KeyPrefix` and `SnsTopicArn`). Once the synthesis task is created, this operation will return a `SpeechSynthesisTask` object, which will include an identifier of this task as well as the current status. The `SpeechSynthesisTask` object is available for 72 hours after starting the asynchronous synthesis task.
1032 1033 1034 1035 |
# File 'lib/aws-sdk-polly/client.rb', line 1032 def start_speech_synthesis_task(params = {}, = {}) req = build_request(:start_speech_synthesis_task, params) req.send_request() end |
#synthesize_speech(params = {}) ⇒ Types::SynthesizeSpeechOutput
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].
[1]: docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html
1189 1190 1191 1192 |
# File 'lib/aws-sdk-polly/client.rb', line 1189 def synthesize_speech(params = {}, = {}, &block) req = build_request(:synthesize_speech, params) req.send_request(, &block) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1218 1219 1220 |
# File 'lib/aws-sdk-polly/client.rb', line 1218 def waiter_names [] end |