aws-sdk-polly 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/aws-sdk-polly.rb +47 -0
- data/lib/aws-sdk-polly/client.rb +423 -0
- data/lib/aws-sdk-polly/client_api.rb +229 -0
- data/lib/aws-sdk-polly/customizations.rb +0 -0
- data/lib/aws-sdk-polly/errors.rb +23 -0
- data/lib/aws-sdk-polly/resource.rb +25 -0
- data/lib/aws-sdk-polly/types.rb +362 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8bda5f8ce52db8ebd61cf6c91487a518799fffdf
|
4
|
+
data.tar.gz: 6cdb641d229003a8c1f6ce2594a45a948f120aae
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0b15b89e991aa5a24c40b69a18a77f1e07b379cccc62edc1dabcf06b8a875a0275eec4cd89dbf7cd35534848ce4eb9d6d4e19faade160a639cdbc3d0a659e013
|
7
|
+
data.tar.gz: c9485bcb0690828f1f2c3c2ff6661fdf5354fe92a2fac955dcfb1a6d011c9aec6123d342cff29cad1e0936aaa0af93e181bcb2c4a001fd39afa3fe543b99e2a6
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
require 'aws-sdk-core'
|
9
|
+
require 'aws-sigv4'
|
10
|
+
|
11
|
+
require_relative 'aws-sdk-polly/types'
|
12
|
+
require_relative 'aws-sdk-polly/client_api'
|
13
|
+
require_relative 'aws-sdk-polly/client'
|
14
|
+
require_relative 'aws-sdk-polly/errors'
|
15
|
+
require_relative 'aws-sdk-polly/resource'
|
16
|
+
require_relative 'aws-sdk-polly/customizations'
|
17
|
+
|
18
|
+
# This module provides support for Amazon Polly. This module is available in the
|
19
|
+
# `aws-sdk-polly` gem.
|
20
|
+
#
|
21
|
+
# # Client
|
22
|
+
#
|
23
|
+
# The {Client} class provides one method for each API operation. Operation
|
24
|
+
# methods each accept a hash of request parameters and return a response
|
25
|
+
# structure.
|
26
|
+
#
|
27
|
+
# See {Client} for more information.
|
28
|
+
#
|
29
|
+
# # Errors
|
30
|
+
#
|
31
|
+
# Errors returned from Amazon Polly all
|
32
|
+
# extend {Errors::ServiceError}.
|
33
|
+
#
|
34
|
+
# begin
|
35
|
+
# # do stuff
|
36
|
+
# rescue Aws::Polly::Errors::ServiceError
|
37
|
+
# # rescues all service API errors
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# See {Errors} for more information.
|
41
|
+
#
|
42
|
+
# @service
|
43
|
+
module Aws::Polly
|
44
|
+
|
45
|
+
GEM_VERSION = '1.0.0.rc2'
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,423 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
require 'seahorse/client/plugins/content_length.rb'
|
9
|
+
require 'aws-sdk-core/plugins/credentials_configuration.rb'
|
10
|
+
require 'aws-sdk-core/plugins/logging.rb'
|
11
|
+
require 'aws-sdk-core/plugins/param_converter.rb'
|
12
|
+
require 'aws-sdk-core/plugins/param_validator.rb'
|
13
|
+
require 'aws-sdk-core/plugins/user_agent.rb'
|
14
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
15
|
+
require 'aws-sdk-core/plugins/retry_errors.rb'
|
16
|
+
require 'aws-sdk-core/plugins/global_configuration.rb'
|
17
|
+
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
18
|
+
require 'aws-sdk-core/plugins/response_paging.rb'
|
19
|
+
require 'aws-sdk-core/plugins/stub_responses.rb'
|
20
|
+
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
21
|
+
require 'aws-sdk-core/plugins/signature_v4.rb'
|
22
|
+
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
23
|
+
|
24
|
+
Aws::Plugins::GlobalConfiguration.add_identifier(:polly)
|
25
|
+
|
26
|
+
module Aws
|
27
|
+
module Polly
|
28
|
+
class Client < Seahorse::Client::Base
|
29
|
+
|
30
|
+
include Aws::ClientStubs
|
31
|
+
|
32
|
+
@identifier = :polly
|
33
|
+
|
34
|
+
set_api(ClientApi::API)
|
35
|
+
|
36
|
+
add_plugin(Seahorse::Client::Plugins::ContentLength)
|
37
|
+
add_plugin(Aws::Plugins::CredentialsConfiguration)
|
38
|
+
add_plugin(Aws::Plugins::Logging)
|
39
|
+
add_plugin(Aws::Plugins::ParamConverter)
|
40
|
+
add_plugin(Aws::Plugins::ParamValidator)
|
41
|
+
add_plugin(Aws::Plugins::UserAgent)
|
42
|
+
add_plugin(Aws::Plugins::HelpfulSocketErrors)
|
43
|
+
add_plugin(Aws::Plugins::RetryErrors)
|
44
|
+
add_plugin(Aws::Plugins::GlobalConfiguration)
|
45
|
+
add_plugin(Aws::Plugins::RegionalEndpoint)
|
46
|
+
add_plugin(Aws::Plugins::ResponsePaging)
|
47
|
+
add_plugin(Aws::Plugins::StubResponses)
|
48
|
+
add_plugin(Aws::Plugins::IdempotencyToken)
|
49
|
+
add_plugin(Aws::Plugins::SignatureV4)
|
50
|
+
add_plugin(Aws::Plugins::Protocols::RestJson)
|
51
|
+
|
52
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
53
|
+
# Your AWS credentials. This can be an instance of any one of the
|
54
|
+
# following classes:
|
55
|
+
#
|
56
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
57
|
+
# credentials.
|
58
|
+
#
|
59
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
60
|
+
# from an EC2 IMDS on an EC2 instance.
|
61
|
+
#
|
62
|
+
# * `Aws::SharedCredentials` - Used for loading credentials from a
|
63
|
+
# shared file, such as `~/.aws/config`.
|
64
|
+
#
|
65
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
66
|
+
#
|
67
|
+
# When `:credentials` are not configured directly, the following
|
68
|
+
# locations will be searched for credentials:
|
69
|
+
#
|
70
|
+
# * `Aws.config[:credentials]`
|
71
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
72
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
73
|
+
# * `~/.aws/credentials`
|
74
|
+
# * `~/.aws/config`
|
75
|
+
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
76
|
+
# very aggressive. Construct and pass an instance of
|
77
|
+
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
78
|
+
# timeouts.
|
79
|
+
# @option options [required, String] :region
|
80
|
+
# The AWS region to connect to. The configured `:region` is
|
81
|
+
# used to determine the service `:endpoint`. When not passed,
|
82
|
+
# a default `:region` is search for in the following locations:
|
83
|
+
#
|
84
|
+
# * `Aws.config[:region]`
|
85
|
+
# * `ENV['AWS_REGION']`
|
86
|
+
# * `ENV['AMAZON_REGION']`
|
87
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
88
|
+
# * `~/.aws/credentials`
|
89
|
+
# * `~/.aws/config`
|
90
|
+
# @option options [String] :access_key_id
|
91
|
+
# @option options [Boolean] :convert_params (true)
|
92
|
+
# When `true`, an attempt is made to coerce request parameters into
|
93
|
+
# the required types.
|
94
|
+
# @option options [String] :endpoint
|
95
|
+
# The client endpoint is normally constructed from the `:region`
|
96
|
+
# option. You should only configure an `:endpoint` when connecting
|
97
|
+
# to test endpoints. This should be avalid HTTP(S) URI.
|
98
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
99
|
+
# The log formatter.
|
100
|
+
# @option options [Symbol] :log_level (:info)
|
101
|
+
# The log level to send messages to the `:logger` at.
|
102
|
+
# @option options [Logger] :logger
|
103
|
+
# The Logger instance to send log messages to. If this option
|
104
|
+
# is not set, logging will be disabled.
|
105
|
+
# @option options [String] :profile ("default")
|
106
|
+
# Used when loading credentials from the shared credentials file
|
107
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
108
|
+
# @option options [Integer] :retry_limit (3)
|
109
|
+
# The maximum number of times to retry failed requests. Only
|
110
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
111
|
+
# are retried. Generally, these are throttling errors, data
|
112
|
+
# checksum errors, networking errors, timeout errors and auth
|
113
|
+
# errors from expired credentials.
|
114
|
+
# @option options [String] :secret_access_key
|
115
|
+
# @option options [String] :session_token
|
116
|
+
# @option options [Boolean] :stub_responses (false)
|
117
|
+
# Causes the client to return stubbed responses. By default
|
118
|
+
# fake responses are generated and returned. You can specify
|
119
|
+
# the response data to return or errors to raise by calling
|
120
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
121
|
+
#
|
122
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
123
|
+
# requests are made, and retries are disabled.
|
124
|
+
# @option options [Boolean] :validate_params (true)
|
125
|
+
# When `true`, request parameters are validated before
|
126
|
+
# sending the request.
|
127
|
+
def initialize(*args)
|
128
|
+
super
|
129
|
+
end
|
130
|
+
|
131
|
+
# @!group API Operations
|
132
|
+
|
133
|
+
# Deletes the specified pronunciation lexicon stored in an AWS Region. A
|
134
|
+
# lexicon which has been deleted is not available for speech synthesis,
|
135
|
+
# nor is it possible to retrieve it using either the `GetLexicon` or
|
136
|
+
# `ListLexicon` APIs.
|
137
|
+
#
|
138
|
+
# For more information, see [Managing Lexicons][1].
|
139
|
+
#
|
140
|
+
#
|
141
|
+
#
|
142
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
|
143
|
+
# @option params [required, String] :name
|
144
|
+
# The name of the lexicon to delete. Must be an existing lexicon in the
|
145
|
+
# region.
|
146
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
147
|
+
#
|
148
|
+
# @example Request syntax with placeholder values
|
149
|
+
# resp = client.delete_lexicon({
|
150
|
+
# name: "LexiconName", # required
|
151
|
+
# })
|
152
|
+
# @overload delete_lexicon(params = {})
|
153
|
+
# @param [Hash] params ({})
|
154
|
+
def delete_lexicon(params = {}, options = {})
|
155
|
+
req = build_request(:delete_lexicon, params)
|
156
|
+
req.send_request(options)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the list of voices that are available for use when requesting
|
160
|
+
# speech synthesis. Each voice speaks a specified language, is either
|
161
|
+
# male or female, and is identified by an ID, which is the ASCII version
|
162
|
+
# of the voice name.
|
163
|
+
#
|
164
|
+
# When synthesizing speech ( `SynthesizeSpeech` ), you provide the voice
|
165
|
+
# ID for the voice you want from the list of voices returned by
|
166
|
+
# `DescribeVoices`.
|
167
|
+
#
|
168
|
+
# For example, you want your news reader application to read news in a
|
169
|
+
# specific language, but giving a user the option to choose the voice.
|
170
|
+
# Using the `DescribeVoices` operation you can provide the user with a
|
171
|
+
# list of available voices to select from.
|
172
|
+
#
|
173
|
+
# You can optionally specify a language code to filter the available
|
174
|
+
# voices. For example, if you specify `en-US`, the operation returns a
|
175
|
+
# list of all available US English voices.
|
176
|
+
#
|
177
|
+
# This operation requires permissions to perform the
|
178
|
+
# `polly:DescribeVoices` action.
|
179
|
+
# @option params [String] :language_code
|
180
|
+
# The language identification tag (ISO 639 code for the language
|
181
|
+
# name-ISO 3166 country code) for filtering the list of voices returned.
|
182
|
+
# If you don't specify this optional parameter, all available voices
|
183
|
+
# are returned.
|
184
|
+
# @option params [String] :next_token
|
185
|
+
# An opaque pagination token returned from the previous `DescribeVoices`
|
186
|
+
# operation. If present, this indicates where to continue the listing.
|
187
|
+
# @return [Types::DescribeVoicesOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
188
|
+
#
|
189
|
+
# * {Types::DescribeVoicesOutput#voices #Voices} => Array<Types::Voice>
|
190
|
+
# * {Types::DescribeVoicesOutput#next_token #NextToken} => String
|
191
|
+
#
|
192
|
+
# @example Request syntax with placeholder values
|
193
|
+
# resp = client.describe_voices({
|
194
|
+
# language_code: "cy-GB", # accepts cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-US, fr-CA, fr-FR, is-IS, it-IT, ja-JP, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR
|
195
|
+
# next_token: "NextToken",
|
196
|
+
# })
|
197
|
+
#
|
198
|
+
# @example Response structure
|
199
|
+
# resp.voices #=> Array
|
200
|
+
# resp.voices[0].gender #=> String, one of "Female", "Male"
|
201
|
+
# resp.voices[0].id #=> String, one of "Geraint", "Gwyneth", "Mads", "Naja", "Hans", "Marlene", "Nicole", "Russell", "Amy", "Brian", "Emma", "Raveena", "Ivy", "Joanna", "Joey", "Justin", "Kendra", "Kimberly", "Salli", "Conchita", "Enrique", "Miguel", "Penelope", "Chantal", "Celine", "Mathieu", "Dora", "Karl", "Carla", "Giorgio", "Mizuki", "Liv", "Lotte", "Ruben", "Ewa", "Jacek", "Jan", "Maja", "Ricardo", "Vitoria", "Cristiano", "Ines", "Carmen", "Maxim", "Tatyana", "Astrid", "Filiz"
|
202
|
+
# resp.voices[0].language_code #=> String, one of "cy-GB", "da-DK", "de-DE", "en-AU", "en-GB", "en-GB-WLS", "en-IN", "en-US", "es-ES", "es-US", "fr-CA", "fr-FR", "is-IS", "it-IT", "ja-JP", "nb-NO", "nl-NL", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "sv-SE", "tr-TR"
|
203
|
+
# resp.voices[0].language_name #=> String
|
204
|
+
# resp.voices[0].name #=> String
|
205
|
+
# resp.next_token #=> String
|
206
|
+
# @overload describe_voices(params = {})
|
207
|
+
# @param [Hash] params ({})
|
208
|
+
def describe_voices(params = {}, options = {})
|
209
|
+
req = build_request(:describe_voices, params)
|
210
|
+
req.send_request(options)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns the content of the specified pronunciation lexicon stored in
|
214
|
+
# an AWS Region. For more information, see [Managing Lexicons][1].
|
215
|
+
#
|
216
|
+
#
|
217
|
+
#
|
218
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
|
219
|
+
# @option params [required, String] :name
|
220
|
+
# Name of the lexicon.
|
221
|
+
# @return [Types::GetLexiconOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
222
|
+
#
|
223
|
+
# * {Types::GetLexiconOutput#lexicon #Lexicon} => Types::Lexicon
|
224
|
+
# * {Types::GetLexiconOutput#lexicon_attributes #LexiconAttributes} => Types::LexiconAttributes
|
225
|
+
#
|
226
|
+
# @example Request syntax with placeholder values
|
227
|
+
# resp = client.get_lexicon({
|
228
|
+
# name: "LexiconName", # required
|
229
|
+
# })
|
230
|
+
#
|
231
|
+
# @example Response structure
|
232
|
+
# resp.lexicon.content #=> String
|
233
|
+
# resp.lexicon.name #=> String
|
234
|
+
# resp.lexicon_attributes.alphabet #=> String
|
235
|
+
# resp.lexicon_attributes.language_code #=> String, one of "cy-GB", "da-DK", "de-DE", "en-AU", "en-GB", "en-GB-WLS", "en-IN", "en-US", "es-ES", "es-US", "fr-CA", "fr-FR", "is-IS", "it-IT", "ja-JP", "nb-NO", "nl-NL", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "sv-SE", "tr-TR"
|
236
|
+
# resp.lexicon_attributes.last_modified #=> Time
|
237
|
+
# resp.lexicon_attributes.lexicon_arn #=> String
|
238
|
+
# resp.lexicon_attributes.lexemes_count #=> Integer
|
239
|
+
# resp.lexicon_attributes.size #=> Integer
|
240
|
+
# @overload get_lexicon(params = {})
|
241
|
+
# @param [Hash] params ({})
|
242
|
+
def get_lexicon(params = {}, options = {})
|
243
|
+
req = build_request(:get_lexicon, params)
|
244
|
+
req.send_request(options)
|
245
|
+
end
|
246
|
+
|
247
|
+
# Returns a list of pronunciation lexicons stored in an AWS Region. For
|
248
|
+
# more information, see [Managing Lexicons][1].
|
249
|
+
#
|
250
|
+
#
|
251
|
+
#
|
252
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
|
253
|
+
# @option params [String] :next_token
|
254
|
+
# An opaque pagination token returned from previous `ListLexicons`
|
255
|
+
# operation. If present, indicates where to continue the list of
|
256
|
+
# lexicons.
|
257
|
+
# @return [Types::ListLexiconsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
258
|
+
#
|
259
|
+
# * {Types::ListLexiconsOutput#lexicons #Lexicons} => Array<Types::LexiconDescription>
|
260
|
+
# * {Types::ListLexiconsOutput#next_token #NextToken} => String
|
261
|
+
#
|
262
|
+
# @example Request syntax with placeholder values
|
263
|
+
# resp = client.list_lexicons({
|
264
|
+
# next_token: "NextToken",
|
265
|
+
# })
|
266
|
+
#
|
267
|
+
# @example Response structure
|
268
|
+
# resp.lexicons #=> Array
|
269
|
+
# resp.lexicons[0].name #=> String
|
270
|
+
# resp.lexicons[0].attributes.alphabet #=> String
|
271
|
+
# resp.lexicons[0].attributes.language_code #=> String, one of "cy-GB", "da-DK", "de-DE", "en-AU", "en-GB", "en-GB-WLS", "en-IN", "en-US", "es-ES", "es-US", "fr-CA", "fr-FR", "is-IS", "it-IT", "ja-JP", "nb-NO", "nl-NL", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "sv-SE", "tr-TR"
|
272
|
+
# resp.lexicons[0].attributes.last_modified #=> Time
|
273
|
+
# resp.lexicons[0].attributes.lexicon_arn #=> String
|
274
|
+
# resp.lexicons[0].attributes.lexemes_count #=> Integer
|
275
|
+
# resp.lexicons[0].attributes.size #=> Integer
|
276
|
+
# resp.next_token #=> String
|
277
|
+
# @overload list_lexicons(params = {})
|
278
|
+
# @param [Hash] params ({})
|
279
|
+
def list_lexicons(params = {}, options = {})
|
280
|
+
req = build_request(:list_lexicons, params)
|
281
|
+
req.send_request(options)
|
282
|
+
end
|
283
|
+
|
284
|
+
# Stores a pronunciation lexicon in an AWS Region. If a lexicon with the
|
285
|
+
# same name already exists in the region, it is overwritten by the new
|
286
|
+
# lexicon. Lexicon operations have eventual consistency, therefore, it
|
287
|
+
# might take some time before the lexicon is available to the
|
288
|
+
# SynthesizeSpeech operation.
|
289
|
+
#
|
290
|
+
# For more information, see [Managing Lexicons][1].
|
291
|
+
#
|
292
|
+
#
|
293
|
+
#
|
294
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
|
295
|
+
# @option params [required, String] :name
|
296
|
+
# Name of the lexicon. The name must follow the regular express format
|
297
|
+
# \[0-9A-Za-z\]\\\{1,20\\}. That is, the name is a case-sensitive
|
298
|
+
# alphanumeric string up to 20 characters long.
|
299
|
+
# @option params [required, String] :content
|
300
|
+
# Content of the PLS lexicon as string data.
|
301
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
302
|
+
#
|
303
|
+
# @example Request syntax with placeholder values
|
304
|
+
# resp = client.put_lexicon({
|
305
|
+
# name: "LexiconName", # required
|
306
|
+
# content: "LexiconContent", # required
|
307
|
+
# })
|
308
|
+
# @overload put_lexicon(params = {})
|
309
|
+
# @param [Hash] params ({})
|
310
|
+
def put_lexicon(params = {}, options = {})
|
311
|
+
req = build_request(:put_lexicon, params)
|
312
|
+
req.send_request(options)
|
313
|
+
end
|
314
|
+
|
315
|
+
# Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
|
316
|
+
# SSML input must be valid, well-formed SSML. Some alphabets might not
|
317
|
+
# be available with all the voices (for example, Cyrillic might not be
|
318
|
+
# read at all by English voices) unless phoneme mapping is used. For
|
319
|
+
# more information, see [How it Works][1].
|
320
|
+
#
|
321
|
+
#
|
322
|
+
#
|
323
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html
|
324
|
+
# @option params [Array<String>] :lexicon_names
|
325
|
+
# List of one or more pronunciation lexicon names you want the service
|
326
|
+
# to apply during synthesis. Lexicons are applied only if the language
|
327
|
+
# of the lexicon is the same as the language of the voice. For
|
328
|
+
# information about storing lexicons, see [PutLexicon][1].
|
329
|
+
#
|
330
|
+
#
|
331
|
+
#
|
332
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html
|
333
|
+
# @option params [required, String] :output_format
|
334
|
+
# The audio format in which the resulting stream will be encoded.
|
335
|
+
# @option params [String] :sample_rate
|
336
|
+
# The audio frequency specified in Hz.
|
337
|
+
#
|
338
|
+
# The valid values for `mp3` and `ogg_vorbis` are "8000", "16000",
|
339
|
+
# and "22050". The default value is "22050".
|
340
|
+
#
|
341
|
+
# Valid values for `pcm` are "8000" and "16000" The default value is
|
342
|
+
# "16000".
|
343
|
+
# @option params [required, String] :text
|
344
|
+
# Input text to synthesize. If you specify `ssml` as the `TextType`,
|
345
|
+
# follow the SSML format for the input text.
|
346
|
+
# @option params [String] :text_type
|
347
|
+
# Specifies whether the input text is plain text or SSML. The default
|
348
|
+
# value is plain text. For more information, see [Using SSML][1].
|
349
|
+
#
|
350
|
+
#
|
351
|
+
#
|
352
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/ssml.html
|
353
|
+
# @option params [required, String] :voice_id
|
354
|
+
# Voice ID to use for the synthesis. You can get a list of available
|
355
|
+
# voice IDs by calling the [DescribeVoices][1] operation.
|
356
|
+
#
|
357
|
+
#
|
358
|
+
#
|
359
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html
|
360
|
+
# @return [Types::SynthesizeSpeechOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
361
|
+
#
|
362
|
+
# * {Types::SynthesizeSpeechOutput#audio_stream #AudioStream} => IO
|
363
|
+
# * {Types::SynthesizeSpeechOutput#content_type #ContentType} => String
|
364
|
+
# * {Types::SynthesizeSpeechOutput#request_characters #RequestCharacters} => Integer
|
365
|
+
#
|
366
|
+
# @example Request syntax with placeholder values
|
367
|
+
# resp = client.synthesize_speech({
|
368
|
+
# lexicon_names: ["LexiconName"],
|
369
|
+
# output_format: "mp3", # required, accepts mp3, ogg_vorbis, pcm
|
370
|
+
# sample_rate: "SampleRate",
|
371
|
+
# text: "Text", # required
|
372
|
+
# text_type: "ssml", # accepts ssml, text
|
373
|
+
# voice_id: "Geraint", # required, accepts Geraint, Gwyneth, Mads, Naja, Hans, Marlene, Nicole, Russell, Amy, Brian, Emma, Raveena, Ivy, Joanna, Joey, Justin, Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, Tatyana, Astrid, Filiz
|
374
|
+
# })
|
375
|
+
#
|
376
|
+
# @example Response structure
|
377
|
+
# resp.audio_stream #=> IO
|
378
|
+
# resp.content_type #=> String
|
379
|
+
# resp.request_characters #=> Integer
|
380
|
+
# @overload synthesize_speech(params = {})
|
381
|
+
# @param [Hash] params ({})
|
382
|
+
def synthesize_speech(params = {}, options = {})
|
383
|
+
req = build_request(:synthesize_speech, params)
|
384
|
+
req.send_request(options)
|
385
|
+
end
|
386
|
+
|
387
|
+
# @!endgroup
|
388
|
+
|
389
|
+
# @param params ({})
|
390
|
+
# @api private
|
391
|
+
def build_request(operation_name, params = {})
|
392
|
+
handlers = @handlers.for(operation_name)
|
393
|
+
context = Seahorse::Client::RequestContext.new(
|
394
|
+
operation_name: operation_name,
|
395
|
+
operation: config.api.operation(operation_name),
|
396
|
+
client: self,
|
397
|
+
params: params,
|
398
|
+
config: config)
|
399
|
+
context[:gem_name] = 'aws-sdk-polly'
|
400
|
+
context[:gem_version] = '1.0.0.rc2'
|
401
|
+
Seahorse::Client::Request.new(handlers, context)
|
402
|
+
end
|
403
|
+
|
404
|
+
# @api private
|
405
|
+
# @deprecated
|
406
|
+
def waiter_names
|
407
|
+
[]
|
408
|
+
end
|
409
|
+
|
410
|
+
class << self
|
411
|
+
|
412
|
+
# @api private
|
413
|
+
attr_reader :identifier
|
414
|
+
|
415
|
+
# @api private
|
416
|
+
def errors_module
|
417
|
+
Errors
|
418
|
+
end
|
419
|
+
|
420
|
+
end
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module Polly
|
10
|
+
# @api private
|
11
|
+
module ClientApi
|
12
|
+
|
13
|
+
include Seahorse::Model
|
14
|
+
|
15
|
+
Alphabet = Shapes::StringShape.new(name: 'Alphabet')
|
16
|
+
AudioStream = Shapes::BlobShape.new(name: 'AudioStream')
|
17
|
+
ContentType = Shapes::StringShape.new(name: 'ContentType')
|
18
|
+
DeleteLexiconInput = Shapes::StructureShape.new(name: 'DeleteLexiconInput')
|
19
|
+
DeleteLexiconOutput = Shapes::StructureShape.new(name: 'DeleteLexiconOutput')
|
20
|
+
DescribeVoicesInput = Shapes::StructureShape.new(name: 'DescribeVoicesInput')
|
21
|
+
DescribeVoicesOutput = Shapes::StructureShape.new(name: 'DescribeVoicesOutput')
|
22
|
+
ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
|
23
|
+
Gender = Shapes::StringShape.new(name: 'Gender')
|
24
|
+
GetLexiconInput = Shapes::StructureShape.new(name: 'GetLexiconInput')
|
25
|
+
GetLexiconOutput = Shapes::StructureShape.new(name: 'GetLexiconOutput')
|
26
|
+
InvalidLexiconException = Shapes::StructureShape.new(name: 'InvalidLexiconException')
|
27
|
+
InvalidNextTokenException = Shapes::StructureShape.new(name: 'InvalidNextTokenException')
|
28
|
+
InvalidSampleRateException = Shapes::StructureShape.new(name: 'InvalidSampleRateException')
|
29
|
+
InvalidSsmlException = Shapes::StructureShape.new(name: 'InvalidSsmlException')
|
30
|
+
LanguageCode = Shapes::StringShape.new(name: 'LanguageCode')
|
31
|
+
LanguageName = Shapes::StringShape.new(name: 'LanguageName')
|
32
|
+
LastModified = Shapes::TimestampShape.new(name: 'LastModified')
|
33
|
+
LexemesCount = Shapes::IntegerShape.new(name: 'LexemesCount')
|
34
|
+
Lexicon = Shapes::StructureShape.new(name: 'Lexicon')
|
35
|
+
LexiconArn = Shapes::StringShape.new(name: 'LexiconArn')
|
36
|
+
LexiconAttributes = Shapes::StructureShape.new(name: 'LexiconAttributes')
|
37
|
+
LexiconContent = Shapes::StringShape.new(name: 'LexiconContent')
|
38
|
+
LexiconDescription = Shapes::StructureShape.new(name: 'LexiconDescription')
|
39
|
+
LexiconDescriptionList = Shapes::ListShape.new(name: 'LexiconDescriptionList')
|
40
|
+
LexiconName = Shapes::StringShape.new(name: 'LexiconName')
|
41
|
+
LexiconNameList = Shapes::ListShape.new(name: 'LexiconNameList')
|
42
|
+
LexiconNotFoundException = Shapes::StructureShape.new(name: 'LexiconNotFoundException')
|
43
|
+
LexiconSizeExceededException = Shapes::StructureShape.new(name: 'LexiconSizeExceededException')
|
44
|
+
ListLexiconsInput = Shapes::StructureShape.new(name: 'ListLexiconsInput')
|
45
|
+
ListLexiconsOutput = Shapes::StructureShape.new(name: 'ListLexiconsOutput')
|
46
|
+
MaxLexemeLengthExceededException = Shapes::StructureShape.new(name: 'MaxLexemeLengthExceededException')
|
47
|
+
MaxLexiconsNumberExceededException = Shapes::StructureShape.new(name: 'MaxLexiconsNumberExceededException')
|
48
|
+
NextToken = Shapes::StringShape.new(name: 'NextToken')
|
49
|
+
OutputFormat = Shapes::StringShape.new(name: 'OutputFormat')
|
50
|
+
PutLexiconInput = Shapes::StructureShape.new(name: 'PutLexiconInput')
|
51
|
+
PutLexiconOutput = Shapes::StructureShape.new(name: 'PutLexiconOutput')
|
52
|
+
RequestCharacters = Shapes::IntegerShape.new(name: 'RequestCharacters')
|
53
|
+
SampleRate = Shapes::StringShape.new(name: 'SampleRate')
|
54
|
+
ServiceFailureException = Shapes::StructureShape.new(name: 'ServiceFailureException')
|
55
|
+
Size = Shapes::IntegerShape.new(name: 'Size')
|
56
|
+
SynthesizeSpeechInput = Shapes::StructureShape.new(name: 'SynthesizeSpeechInput')
|
57
|
+
SynthesizeSpeechOutput = Shapes::StructureShape.new(name: 'SynthesizeSpeechOutput')
|
58
|
+
Text = Shapes::StringShape.new(name: 'Text')
|
59
|
+
TextLengthExceededException = Shapes::StructureShape.new(name: 'TextLengthExceededException')
|
60
|
+
TextType = Shapes::StringShape.new(name: 'TextType')
|
61
|
+
UnsupportedPlsAlphabetException = Shapes::StructureShape.new(name: 'UnsupportedPlsAlphabetException')
|
62
|
+
UnsupportedPlsLanguageException = Shapes::StructureShape.new(name: 'UnsupportedPlsLanguageException')
|
63
|
+
Voice = Shapes::StructureShape.new(name: 'Voice')
|
64
|
+
VoiceId = Shapes::StringShape.new(name: 'VoiceId')
|
65
|
+
VoiceList = Shapes::ListShape.new(name: 'VoiceList')
|
66
|
+
VoiceName = Shapes::StringShape.new(name: 'VoiceName')
|
67
|
+
|
68
|
+
DeleteLexiconInput.add_member(:name, Shapes::ShapeRef.new(shape: LexiconName, required: true, location: "uri", location_name: "LexiconName"))
|
69
|
+
DeleteLexiconInput.struct_class = Types::DeleteLexiconInput
|
70
|
+
|
71
|
+
DeleteLexiconOutput.struct_class = Types::DeleteLexiconOutput
|
72
|
+
|
73
|
+
DescribeVoicesInput.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, location: "querystring", location_name: "LanguageCode"))
|
74
|
+
DescribeVoicesInput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "NextToken"))
|
75
|
+
DescribeVoicesInput.struct_class = Types::DescribeVoicesInput
|
76
|
+
|
77
|
+
DescribeVoicesOutput.add_member(:voices, Shapes::ShapeRef.new(shape: VoiceList, location_name: "Voices"))
|
78
|
+
DescribeVoicesOutput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
|
79
|
+
DescribeVoicesOutput.struct_class = Types::DescribeVoicesOutput
|
80
|
+
|
81
|
+
GetLexiconInput.add_member(:name, Shapes::ShapeRef.new(shape: LexiconName, required: true, location: "uri", location_name: "LexiconName"))
|
82
|
+
GetLexiconInput.struct_class = Types::GetLexiconInput
|
83
|
+
|
84
|
+
GetLexiconOutput.add_member(:lexicon, Shapes::ShapeRef.new(shape: Lexicon, location_name: "Lexicon"))
|
85
|
+
GetLexiconOutput.add_member(:lexicon_attributes, Shapes::ShapeRef.new(shape: LexiconAttributes, location_name: "LexiconAttributes"))
|
86
|
+
GetLexiconOutput.struct_class = Types::GetLexiconOutput
|
87
|
+
|
88
|
+
Lexicon.add_member(:content, Shapes::ShapeRef.new(shape: LexiconContent, location_name: "Content"))
|
89
|
+
Lexicon.add_member(:name, Shapes::ShapeRef.new(shape: LexiconName, location_name: "Name"))
|
90
|
+
Lexicon.struct_class = Types::Lexicon
|
91
|
+
|
92
|
+
LexiconAttributes.add_member(:alphabet, Shapes::ShapeRef.new(shape: Alphabet, location_name: "Alphabet"))
|
93
|
+
LexiconAttributes.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, location_name: "LanguageCode"))
|
94
|
+
LexiconAttributes.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified"))
|
95
|
+
LexiconAttributes.add_member(:lexicon_arn, Shapes::ShapeRef.new(shape: LexiconArn, location_name: "LexiconArn"))
|
96
|
+
LexiconAttributes.add_member(:lexemes_count, Shapes::ShapeRef.new(shape: LexemesCount, location_name: "LexemesCount"))
|
97
|
+
LexiconAttributes.add_member(:size, Shapes::ShapeRef.new(shape: Size, location_name: "Size"))
|
98
|
+
LexiconAttributes.struct_class = Types::LexiconAttributes
|
99
|
+
|
100
|
+
LexiconDescription.add_member(:name, Shapes::ShapeRef.new(shape: LexiconName, location_name: "Name"))
|
101
|
+
LexiconDescription.add_member(:attributes, Shapes::ShapeRef.new(shape: LexiconAttributes, location_name: "Attributes"))
|
102
|
+
LexiconDescription.struct_class = Types::LexiconDescription
|
103
|
+
|
104
|
+
LexiconDescriptionList.member = Shapes::ShapeRef.new(shape: LexiconDescription)
|
105
|
+
|
106
|
+
LexiconNameList.member = Shapes::ShapeRef.new(shape: LexiconName)
|
107
|
+
|
108
|
+
ListLexiconsInput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "NextToken"))
|
109
|
+
ListLexiconsInput.struct_class = Types::ListLexiconsInput
|
110
|
+
|
111
|
+
ListLexiconsOutput.add_member(:lexicons, Shapes::ShapeRef.new(shape: LexiconDescriptionList, location_name: "Lexicons"))
|
112
|
+
ListLexiconsOutput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
|
113
|
+
ListLexiconsOutput.struct_class = Types::ListLexiconsOutput
|
114
|
+
|
115
|
+
PutLexiconInput.add_member(:name, Shapes::ShapeRef.new(shape: LexiconName, required: true, location: "uri", location_name: "LexiconName"))
|
116
|
+
PutLexiconInput.add_member(:content, Shapes::ShapeRef.new(shape: LexiconContent, required: true, location_name: "Content"))
|
117
|
+
PutLexiconInput.struct_class = Types::PutLexiconInput
|
118
|
+
|
119
|
+
PutLexiconOutput.struct_class = Types::PutLexiconOutput
|
120
|
+
|
121
|
+
SynthesizeSpeechInput.add_member(:lexicon_names, Shapes::ShapeRef.new(shape: LexiconNameList, location_name: "LexiconNames"))
|
122
|
+
SynthesizeSpeechInput.add_member(:output_format, Shapes::ShapeRef.new(shape: OutputFormat, required: true, location_name: "OutputFormat"))
|
123
|
+
SynthesizeSpeechInput.add_member(:sample_rate, Shapes::ShapeRef.new(shape: SampleRate, location_name: "SampleRate"))
|
124
|
+
SynthesizeSpeechInput.add_member(:text, Shapes::ShapeRef.new(shape: Text, required: true, location_name: "Text"))
|
125
|
+
SynthesizeSpeechInput.add_member(:text_type, Shapes::ShapeRef.new(shape: TextType, location_name: "TextType"))
|
126
|
+
SynthesizeSpeechInput.add_member(:voice_id, Shapes::ShapeRef.new(shape: VoiceId, required: true, location_name: "VoiceId"))
|
127
|
+
SynthesizeSpeechInput.struct_class = Types::SynthesizeSpeechInput
|
128
|
+
|
129
|
+
SynthesizeSpeechOutput.add_member(:audio_stream, Shapes::ShapeRef.new(shape: AudioStream, location_name: "AudioStream"))
|
130
|
+
SynthesizeSpeechOutput.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type"))
|
131
|
+
SynthesizeSpeechOutput.add_member(:request_characters, Shapes::ShapeRef.new(shape: RequestCharacters, location: "header", location_name: "x-amzn-RequestCharacters"))
|
132
|
+
SynthesizeSpeechOutput.struct_class = Types::SynthesizeSpeechOutput
|
133
|
+
SynthesizeSpeechOutput[:payload] = :audio_stream
|
134
|
+
SynthesizeSpeechOutput[:payload_member] = SynthesizeSpeechOutput.member(:audio_stream)
|
135
|
+
|
136
|
+
Voice.add_member(:gender, Shapes::ShapeRef.new(shape: Gender, location_name: "Gender"))
|
137
|
+
Voice.add_member(:id, Shapes::ShapeRef.new(shape: VoiceId, location_name: "Id"))
|
138
|
+
Voice.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, location_name: "LanguageCode"))
|
139
|
+
Voice.add_member(:language_name, Shapes::ShapeRef.new(shape: LanguageName, location_name: "LanguageName"))
|
140
|
+
Voice.add_member(:name, Shapes::ShapeRef.new(shape: VoiceName, location_name: "Name"))
|
141
|
+
Voice.struct_class = Types::Voice
|
142
|
+
|
143
|
+
VoiceList.member = Shapes::ShapeRef.new(shape: Voice)
|
144
|
+
|
145
|
+
|
146
|
+
# @api private
|
147
|
+
API = Seahorse::Model::Api.new.tap do |api|
|
148
|
+
|
149
|
+
api.version = "2016-06-10"
|
150
|
+
|
151
|
+
api.metadata = {
|
152
|
+
"endpointPrefix" => "polly",
|
153
|
+
"protocol" => "rest-json",
|
154
|
+
"serviceFullName" => "Amazon Polly",
|
155
|
+
"signatureVersion" => "v4",
|
156
|
+
}
|
157
|
+
|
158
|
+
api.add_operation(:delete_lexicon, Seahorse::Model::Operation.new.tap do |o|
|
159
|
+
o.name = "DeleteLexicon"
|
160
|
+
o.http_method = "DELETE"
|
161
|
+
o.http_request_uri = "/v1/lexicons/{LexiconName}"
|
162
|
+
o.input = Shapes::ShapeRef.new(shape: DeleteLexiconInput)
|
163
|
+
o.output = Shapes::ShapeRef.new(shape: DeleteLexiconOutput)
|
164
|
+
o.errors << Shapes::ShapeRef.new(shape: LexiconNotFoundException)
|
165
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
166
|
+
end)
|
167
|
+
|
168
|
+
api.add_operation(:describe_voices, Seahorse::Model::Operation.new.tap do |o|
|
169
|
+
o.name = "DescribeVoices"
|
170
|
+
o.http_method = "GET"
|
171
|
+
o.http_request_uri = "/v1/voices"
|
172
|
+
o.input = Shapes::ShapeRef.new(shape: DescribeVoicesInput)
|
173
|
+
o.output = Shapes::ShapeRef.new(shape: DescribeVoicesOutput)
|
174
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidNextTokenException)
|
175
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
176
|
+
end)
|
177
|
+
|
178
|
+
api.add_operation(:get_lexicon, Seahorse::Model::Operation.new.tap do |o|
|
179
|
+
o.name = "GetLexicon"
|
180
|
+
o.http_method = "GET"
|
181
|
+
o.http_request_uri = "/v1/lexicons/{LexiconName}"
|
182
|
+
o.input = Shapes::ShapeRef.new(shape: GetLexiconInput)
|
183
|
+
o.output = Shapes::ShapeRef.new(shape: GetLexiconOutput)
|
184
|
+
o.errors << Shapes::ShapeRef.new(shape: LexiconNotFoundException)
|
185
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
186
|
+
end)
|
187
|
+
|
188
|
+
api.add_operation(:list_lexicons, Seahorse::Model::Operation.new.tap do |o|
|
189
|
+
o.name = "ListLexicons"
|
190
|
+
o.http_method = "GET"
|
191
|
+
o.http_request_uri = "/v1/lexicons"
|
192
|
+
o.input = Shapes::ShapeRef.new(shape: ListLexiconsInput)
|
193
|
+
o.output = Shapes::ShapeRef.new(shape: ListLexiconsOutput)
|
194
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidNextTokenException)
|
195
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
196
|
+
end)
|
197
|
+
|
198
|
+
api.add_operation(:put_lexicon, Seahorse::Model::Operation.new.tap do |o|
|
199
|
+
o.name = "PutLexicon"
|
200
|
+
o.http_method = "PUT"
|
201
|
+
o.http_request_uri = "/v1/lexicons/{LexiconName}"
|
202
|
+
o.input = Shapes::ShapeRef.new(shape: PutLexiconInput)
|
203
|
+
o.output = Shapes::ShapeRef.new(shape: PutLexiconOutput)
|
204
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidLexiconException)
|
205
|
+
o.errors << Shapes::ShapeRef.new(shape: UnsupportedPlsAlphabetException)
|
206
|
+
o.errors << Shapes::ShapeRef.new(shape: UnsupportedPlsLanguageException)
|
207
|
+
o.errors << Shapes::ShapeRef.new(shape: LexiconSizeExceededException)
|
208
|
+
o.errors << Shapes::ShapeRef.new(shape: MaxLexemeLengthExceededException)
|
209
|
+
o.errors << Shapes::ShapeRef.new(shape: MaxLexiconsNumberExceededException)
|
210
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
211
|
+
end)
|
212
|
+
|
213
|
+
api.add_operation(:synthesize_speech, Seahorse::Model::Operation.new.tap do |o|
|
214
|
+
o.name = "SynthesizeSpeech"
|
215
|
+
o.http_method = "POST"
|
216
|
+
o.http_request_uri = "/v1/speech"
|
217
|
+
o.input = Shapes::ShapeRef.new(shape: SynthesizeSpeechInput)
|
218
|
+
o.output = Shapes::ShapeRef.new(shape: SynthesizeSpeechOutput)
|
219
|
+
o.errors << Shapes::ShapeRef.new(shape: TextLengthExceededException)
|
220
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidSampleRateException)
|
221
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidSsmlException)
|
222
|
+
o.errors << Shapes::ShapeRef.new(shape: LexiconNotFoundException)
|
223
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceFailureException)
|
224
|
+
end)
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module Polly
|
10
|
+
module Errors
|
11
|
+
|
12
|
+
extend Aws::Errors::DynamicErrors
|
13
|
+
|
14
|
+
# Raised when calling #load or #data on a resource class that can not be
|
15
|
+
# loaded. This can happen when:
|
16
|
+
#
|
17
|
+
# * A resource class has identifiers, but no data attributes.
|
18
|
+
# * Resource data is only available when making an API call that
|
19
|
+
# enumerates all resources of that type.
|
20
|
+
class ResourceNotLoadable < RuntimeError; end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module Polly
|
10
|
+
class Resource
|
11
|
+
|
12
|
+
# @param options ({})
|
13
|
+
# @option options [Client] :client
|
14
|
+
def initialize(options = {})
|
15
|
+
@client = options[:client] || Client.new(options)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Client]
|
19
|
+
def client
|
20
|
+
@client
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,362 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module Polly
|
10
|
+
module Types
|
11
|
+
|
12
|
+
# @note When making an API call, pass DeleteLexiconInput
|
13
|
+
# data as a hash:
|
14
|
+
#
|
15
|
+
# {
|
16
|
+
# name: "LexiconName", # required
|
17
|
+
# }
|
18
|
+
# @!attribute [rw] name
|
19
|
+
# The name of the lexicon to delete. Must be an existing lexicon in
|
20
|
+
# the region.
|
21
|
+
# @return [String]
|
22
|
+
class DeleteLexiconInput < Struct.new(
|
23
|
+
:name)
|
24
|
+
include Aws::Structure
|
25
|
+
end
|
26
|
+
|
27
|
+
class DeleteLexiconOutput < Aws::EmptyStructure; end
|
28
|
+
|
29
|
+
# @note When making an API call, pass DescribeVoicesInput
|
30
|
+
# data as a hash:
|
31
|
+
#
|
32
|
+
# {
|
33
|
+
# language_code: "cy-GB", # accepts cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-US, fr-CA, fr-FR, is-IS, it-IT, ja-JP, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR
|
34
|
+
# next_token: "NextToken",
|
35
|
+
# }
|
36
|
+
# @!attribute [rw] language_code
|
37
|
+
# The language identification tag (ISO 639 code for the language
|
38
|
+
# name-ISO 3166 country code) for filtering the list of voices
|
39
|
+
# returned. If you don't specify this optional parameter, all
|
40
|
+
# available voices are returned.
|
41
|
+
# @return [String]
|
42
|
+
#
|
43
|
+
# @!attribute [rw] next_token
|
44
|
+
# An opaque pagination token returned from the previous
|
45
|
+
# `DescribeVoices` operation. If present, this indicates where to
|
46
|
+
# continue the listing.
|
47
|
+
# @return [String]
|
48
|
+
class DescribeVoicesInput < Struct.new(
|
49
|
+
:language_code,
|
50
|
+
:next_token)
|
51
|
+
include Aws::Structure
|
52
|
+
end
|
53
|
+
|
54
|
+
# @!attribute [rw] voices
|
55
|
+
# A list of voices with their properties.
|
56
|
+
# @return [Array<Types::Voice>]
|
57
|
+
#
|
58
|
+
# @!attribute [rw] next_token
|
59
|
+
# The pagination token to use in the next request to continue the
|
60
|
+
# listing of voices. `NextToken` is returned only if the response is
|
61
|
+
# truncated.
|
62
|
+
# @return [String]
|
63
|
+
class DescribeVoicesOutput < Struct.new(
|
64
|
+
:voices,
|
65
|
+
:next_token)
|
66
|
+
include Aws::Structure
|
67
|
+
end
|
68
|
+
|
69
|
+
# @note When making an API call, pass GetLexiconInput
|
70
|
+
# data as a hash:
|
71
|
+
#
|
72
|
+
# {
|
73
|
+
# name: "LexiconName", # required
|
74
|
+
# }
|
75
|
+
# @!attribute [rw] name
|
76
|
+
# Name of the lexicon.
|
77
|
+
# @return [String]
|
78
|
+
class GetLexiconInput < Struct.new(
|
79
|
+
:name)
|
80
|
+
include Aws::Structure
|
81
|
+
end
|
82
|
+
|
83
|
+
# @!attribute [rw] lexicon
|
84
|
+
# Lexicon object that provides name and the string content of the
|
85
|
+
# lexicon.
|
86
|
+
# @return [Types::Lexicon]
|
87
|
+
#
|
88
|
+
# @!attribute [rw] lexicon_attributes
|
89
|
+
# Metadata of the lexicon, including phonetic alphabetic used,
|
90
|
+
# language code, lexicon ARN, number of lexemes defined in the
|
91
|
+
# lexicon, and size of lexicon in bytes.
|
92
|
+
# @return [Types::LexiconAttributes]
|
93
|
+
class GetLexiconOutput < Struct.new(
|
94
|
+
:lexicon,
|
95
|
+
:lexicon_attributes)
|
96
|
+
include Aws::Structure
|
97
|
+
end
|
98
|
+
|
99
|
+
# Provides lexicon name and lexicon content in string format. For more
|
100
|
+
# information, see [Pronunciation Lexicon Specification (PLS) Version
|
101
|
+
# 1.0][1].
|
102
|
+
#
|
103
|
+
#
|
104
|
+
#
|
105
|
+
# [1]: https://www.w3.org/TR/pronunciation-lexicon/
|
106
|
+
# @!attribute [rw] content
|
107
|
+
# Lexicon content in string format. The content of a lexicon must be
|
108
|
+
# in PLS format.
|
109
|
+
# @return [String]
|
110
|
+
#
|
111
|
+
# @!attribute [rw] name
|
112
|
+
# Name of the lexicon.
|
113
|
+
# @return [String]
|
114
|
+
class Lexicon < Struct.new(
|
115
|
+
:content,
|
116
|
+
:name)
|
117
|
+
include Aws::Structure
|
118
|
+
end
|
119
|
+
|
120
|
+
# Contains metadata describing the lexicon such as the number of
|
121
|
+
# lexemes, language code, and so on. For more information, see [Managing
|
122
|
+
# Lexicons][1].
|
123
|
+
#
|
124
|
+
#
|
125
|
+
#
|
126
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html
|
127
|
+
# @!attribute [rw] alphabet
|
128
|
+
# Phonetic alphabet used in the lexicon. Valid values are `ipa` and
|
129
|
+
# `x-sampa`.
|
130
|
+
# @return [String]
|
131
|
+
#
|
132
|
+
# @!attribute [rw] language_code
|
133
|
+
# Language code that the lexicon applies to. A lexicon with a language
|
134
|
+
# code such as "en" would be applied to all English languages
|
135
|
+
# (en-GB, en-US, en-AUS, en-WLS, and so on.
|
136
|
+
# @return [String]
|
137
|
+
#
|
138
|
+
# @!attribute [rw] last_modified
|
139
|
+
# Date lexicon was last modified (a timestamp value).
|
140
|
+
# @return [Time]
|
141
|
+
#
|
142
|
+
# @!attribute [rw] lexicon_arn
|
143
|
+
# Amazon Resource Name (ARN) of the lexicon.
|
144
|
+
# @return [String]
|
145
|
+
#
|
146
|
+
# @!attribute [rw] lexemes_count
|
147
|
+
# Number of lexemes in the lexicon.
|
148
|
+
# @return [Integer]
|
149
|
+
#
|
150
|
+
# @!attribute [rw] size
|
151
|
+
# Total size of the lexicon, in characters.
|
152
|
+
# @return [Integer]
|
153
|
+
class LexiconAttributes < Struct.new(
|
154
|
+
:alphabet,
|
155
|
+
:language_code,
|
156
|
+
:last_modified,
|
157
|
+
:lexicon_arn,
|
158
|
+
:lexemes_count,
|
159
|
+
:size)
|
160
|
+
include Aws::Structure
|
161
|
+
end
|
162
|
+
|
163
|
+
# Describes the content of the lexicon.
|
164
|
+
# @!attribute [rw] name
|
165
|
+
# Name of the lexicon.
|
166
|
+
# @return [String]
|
167
|
+
#
|
168
|
+
# @!attribute [rw] attributes
|
169
|
+
# Provides lexicon metadata.
|
170
|
+
# @return [Types::LexiconAttributes]
|
171
|
+
class LexiconDescription < Struct.new(
|
172
|
+
:name,
|
173
|
+
:attributes)
|
174
|
+
include Aws::Structure
|
175
|
+
end
|
176
|
+
|
177
|
+
# @note When making an API call, pass ListLexiconsInput
|
178
|
+
# data as a hash:
|
179
|
+
#
|
180
|
+
# {
|
181
|
+
# next_token: "NextToken",
|
182
|
+
# }
|
183
|
+
# @!attribute [rw] next_token
|
184
|
+
# An opaque pagination token returned from previous `ListLexicons`
|
185
|
+
# operation. If present, indicates where to continue the list of
|
186
|
+
# lexicons.
|
187
|
+
# @return [String]
|
188
|
+
class ListLexiconsInput < Struct.new(
|
189
|
+
:next_token)
|
190
|
+
include Aws::Structure
|
191
|
+
end
|
192
|
+
|
193
|
+
# @!attribute [rw] lexicons
|
194
|
+
# A list of lexicon names and attributes.
|
195
|
+
# @return [Array<Types::LexiconDescription>]
|
196
|
+
#
|
197
|
+
# @!attribute [rw] next_token
|
198
|
+
# The pagination token to use in the next request to continue the
|
199
|
+
# listing of lexicons. `NextToken` is returned only if the response is
|
200
|
+
# truncated.
|
201
|
+
# @return [String]
|
202
|
+
class ListLexiconsOutput < Struct.new(
|
203
|
+
:lexicons,
|
204
|
+
:next_token)
|
205
|
+
include Aws::Structure
|
206
|
+
end
|
207
|
+
|
208
|
+
# @note When making an API call, pass PutLexiconInput
|
209
|
+
# data as a hash:
|
210
|
+
#
|
211
|
+
# {
|
212
|
+
# name: "LexiconName", # required
|
213
|
+
# content: "LexiconContent", # required
|
214
|
+
# }
|
215
|
+
# @!attribute [rw] name
|
216
|
+
# Name of the lexicon. The name must follow the regular express format
|
217
|
+
# \[0-9A-Za-z\]\\\{1,20\\}. That is, the name is a case-sensitive
|
218
|
+
# alphanumeric string up to 20 characters long.
|
219
|
+
# @return [String]
|
220
|
+
#
|
221
|
+
# @!attribute [rw] content
|
222
|
+
# Content of the PLS lexicon as string data.
|
223
|
+
# @return [String]
|
224
|
+
class PutLexiconInput < Struct.new(
|
225
|
+
:name,
|
226
|
+
:content)
|
227
|
+
include Aws::Structure
|
228
|
+
end
|
229
|
+
|
230
|
+
class PutLexiconOutput < Aws::EmptyStructure; end
|
231
|
+
|
232
|
+
# @note When making an API call, pass SynthesizeSpeechInput
|
233
|
+
# data as a hash:
|
234
|
+
#
|
235
|
+
# {
|
236
|
+
# lexicon_names: ["LexiconName"],
|
237
|
+
# output_format: "mp3", # required, accepts mp3, ogg_vorbis, pcm
|
238
|
+
# sample_rate: "SampleRate",
|
239
|
+
# text: "Text", # required
|
240
|
+
# text_type: "ssml", # accepts ssml, text
|
241
|
+
# voice_id: "Geraint", # required, accepts Geraint, Gwyneth, Mads, Naja, Hans, Marlene, Nicole, Russell, Amy, Brian, Emma, Raveena, Ivy, Joanna, Joey, Justin, Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, Tatyana, Astrid, Filiz
|
242
|
+
# }
|
243
|
+
# @!attribute [rw] lexicon_names
|
244
|
+
# List of one or more pronunciation lexicon names you want the service
|
245
|
+
# to apply during synthesis. Lexicons are applied only if the language
|
246
|
+
# of the lexicon is the same as the language of the voice. For
|
247
|
+
# information about storing lexicons, see [PutLexicon][1].
|
248
|
+
#
|
249
|
+
#
|
250
|
+
#
|
251
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html
|
252
|
+
# @return [Array<String>]
|
253
|
+
#
|
254
|
+
# @!attribute [rw] output_format
|
255
|
+
# The audio format in which the resulting stream will be encoded.
|
256
|
+
# @return [String]
|
257
|
+
#
|
258
|
+
# @!attribute [rw] sample_rate
|
259
|
+
# The audio frequency specified in Hz.
|
260
|
+
#
|
261
|
+
# The valid values for `mp3` and `ogg_vorbis` are "8000", "16000",
|
262
|
+
# and "22050". The default value is "22050".
|
263
|
+
#
|
264
|
+
# Valid values for `pcm` are "8000" and "16000" The default value
|
265
|
+
# is "16000".
|
266
|
+
# @return [String]
|
267
|
+
#
|
268
|
+
# @!attribute [rw] text
|
269
|
+
# Input text to synthesize. If you specify `ssml` as the `TextType`,
|
270
|
+
# follow the SSML format for the input text.
|
271
|
+
# @return [String]
|
272
|
+
#
|
273
|
+
# @!attribute [rw] text_type
|
274
|
+
# Specifies whether the input text is plain text or SSML. The default
|
275
|
+
# value is plain text. For more information, see [Using SSML][1].
|
276
|
+
#
|
277
|
+
#
|
278
|
+
#
|
279
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/ssml.html
|
280
|
+
# @return [String]
|
281
|
+
#
|
282
|
+
# @!attribute [rw] voice_id
|
283
|
+
# Voice ID to use for the synthesis. You can get a list of available
|
284
|
+
# voice IDs by calling the [DescribeVoices][1] operation.
|
285
|
+
#
|
286
|
+
#
|
287
|
+
#
|
288
|
+
# [1]: http://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html
|
289
|
+
# @return [String]
|
290
|
+
class SynthesizeSpeechInput < Struct.new(
|
291
|
+
:lexicon_names,
|
292
|
+
:output_format,
|
293
|
+
:sample_rate,
|
294
|
+
:text,
|
295
|
+
:text_type,
|
296
|
+
:voice_id)
|
297
|
+
include Aws::Structure
|
298
|
+
end
|
299
|
+
|
300
|
+
# @!attribute [rw] audio_stream
|
301
|
+
# Stream containing the synthesized speech.
|
302
|
+
# @return [IO]
|
303
|
+
#
|
304
|
+
# @!attribute [rw] content_type
|
305
|
+
# Specifies the type audio stream. This should reflect the
|
306
|
+
# `OutputFormat` parameter in your request.
|
307
|
+
#
|
308
|
+
# * If you request `mp3` as the `OutputFormat`, the `ContentType`
|
309
|
+
# returned is audio/mpeg.
|
310
|
+
#
|
311
|
+
# * If you request `ogg_vorbis` as the `OutputFormat`, the
|
312
|
+
# `ContentType` returned is audio/ogg.
|
313
|
+
#
|
314
|
+
# * If you request `pcm` as the `OutputFormat`, the `ContentType`
|
315
|
+
# returned is audio/pcm.
|
316
|
+
# @return [String]
|
317
|
+
#
|
318
|
+
# @!attribute [rw] request_characters
|
319
|
+
# Number of characters synthesized.
|
320
|
+
# @return [Integer]
|
321
|
+
class SynthesizeSpeechOutput < Struct.new(
|
322
|
+
:audio_stream,
|
323
|
+
:content_type,
|
324
|
+
:request_characters)
|
325
|
+
include Aws::Structure
|
326
|
+
end
|
327
|
+
|
328
|
+
# Description of the voice.
|
329
|
+
# @!attribute [rw] gender
|
330
|
+
# Gender of the voice.
|
331
|
+
# @return [String]
|
332
|
+
#
|
333
|
+
# @!attribute [rw] id
|
334
|
+
# Amazon Polly assigned voice ID. This is the ID that you specify when
|
335
|
+
# calling the `SynthesizeSpeech` operation.
|
336
|
+
# @return [String]
|
337
|
+
#
|
338
|
+
# @!attribute [rw] language_code
|
339
|
+
# Language code of the voice.
|
340
|
+
# @return [String]
|
341
|
+
#
|
342
|
+
# @!attribute [rw] language_name
|
343
|
+
# Human readable name of the language in English.
|
344
|
+
# @return [String]
|
345
|
+
#
|
346
|
+
# @!attribute [rw] name
|
347
|
+
# Name of the voice (for example, Salli, Kendra, etc.). This provides
|
348
|
+
# a human readable voice name that you might display in your
|
349
|
+
# application.
|
350
|
+
# @return [String]
|
351
|
+
class Voice < Struct.new(
|
352
|
+
:gender,
|
353
|
+
:id,
|
354
|
+
:language_code,
|
355
|
+
:language_name,
|
356
|
+
:name)
|
357
|
+
include Aws::Structure
|
358
|
+
end
|
359
|
+
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aws-sdk-polly
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.rc2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Amazon Web Services
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aws-sdk-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.0.0.rc1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0.rc1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: aws-sigv4
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
description: Official AWS Ruby gem for Amazon Polly. This gem is part of the AWS SDK
|
42
|
+
for Ruby.
|
43
|
+
email:
|
44
|
+
- trevrowe@amazon.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- lib/aws-sdk-polly.rb
|
50
|
+
- lib/aws-sdk-polly/client.rb
|
51
|
+
- lib/aws-sdk-polly/client_api.rb
|
52
|
+
- lib/aws-sdk-polly/customizations.rb
|
53
|
+
- lib/aws-sdk-polly/errors.rb
|
54
|
+
- lib/aws-sdk-polly/resource.rb
|
55
|
+
- lib/aws-sdk-polly/types.rb
|
56
|
+
homepage: http://github.com/aws/aws-sdk-ruby
|
57
|
+
licenses:
|
58
|
+
- Apache-2.0
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 1.3.1
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.5.1
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: AWS SDK for Ruby - Amazon Polly
|
80
|
+
test_files: []
|