google-cloud-text_to_speech-v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +71 -0
- data/lib/google-cloud-text_to_speech-v1.rb +21 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/text_to_speech/v1.rb +35 -0
- data/lib/google/cloud/text_to_speech/v1/text_to_speech.rb +48 -0
- data/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb +451 -0
- data/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb +51 -0
- data/lib/google/cloud/text_to_speech/v1/version.rb +28 -0
- data/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb +82 -0
- data/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb +49 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb +234 -0
- metadata +172 -0
@@ -0,0 +1,234 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module TextToSpeech
|
23
|
+
module V1
|
24
|
+
# The top-level message sent by the client for the `ListVoices` method.
|
25
|
+
# @!attribute [rw] language_code
|
26
|
+
# @return [::String]
|
27
|
+
# Optional. Recommended.
|
28
|
+
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
|
29
|
+
# specified, the ListVoices call will only return voices that can be used to
|
30
|
+
# synthesize this language_code. E.g. when specifying "en-NZ", you will get
|
31
|
+
# supported "en-*" voices; when specifying "no", you will get supported
|
32
|
+
# "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh"
|
33
|
+
# will also get supported "cmn-*" voices; specifying "zh-hk" will also get
|
34
|
+
# supported "yue-*" voices.
|
35
|
+
class ListVoicesRequest
|
36
|
+
include ::Google::Protobuf::MessageExts
|
37
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
38
|
+
end
|
39
|
+
|
40
|
+
# The message returned to the client by the `ListVoices` method.
|
41
|
+
# @!attribute [rw] voices
|
42
|
+
# @return [::Array<::Google::Cloud::TextToSpeech::V1::Voice>]
|
43
|
+
# The list of voices.
|
44
|
+
class ListVoicesResponse
|
45
|
+
include ::Google::Protobuf::MessageExts
|
46
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
47
|
+
end
|
48
|
+
|
49
|
+
# Description of a voice supported by the TTS service.
|
50
|
+
# @!attribute [rw] language_codes
|
51
|
+
# @return [::Array<::String>]
|
52
|
+
# The languages that this voice supports, expressed as
|
53
|
+
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
|
54
|
+
# "en-US", "es-419", "cmn-tw").
|
55
|
+
# @!attribute [rw] name
|
56
|
+
# @return [::String]
|
57
|
+
# The name of this voice. Each distinct voice has a unique name.
|
58
|
+
# @!attribute [rw] ssml_gender
|
59
|
+
# @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender]
|
60
|
+
# The gender of this voice.
|
61
|
+
# @!attribute [rw] natural_sample_rate_hertz
|
62
|
+
# @return [::Integer]
|
63
|
+
# The natural sample rate (in hertz) for this voice.
|
64
|
+
class Voice
|
65
|
+
include ::Google::Protobuf::MessageExts
|
66
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
67
|
+
end
|
68
|
+
|
69
|
+
# The top-level message sent by the client for the `SynthesizeSpeech` method.
|
70
|
+
# @!attribute [rw] input
|
71
|
+
# @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput]
|
72
|
+
# Required. The Synthesizer requires either plain text or SSML as input.
|
73
|
+
# @!attribute [rw] voice
|
74
|
+
# @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams]
|
75
|
+
# Required. The desired voice of the synthesized audio.
|
76
|
+
# @!attribute [rw] audio_config
|
77
|
+
# @return [::Google::Cloud::TextToSpeech::V1::AudioConfig]
|
78
|
+
# Required. The configuration of the synthesized audio.
|
79
|
+
class SynthesizeSpeechRequest
|
80
|
+
include ::Google::Protobuf::MessageExts
|
81
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
82
|
+
end
|
83
|
+
|
84
|
+
# Contains text input to be synthesized. Either `text` or `ssml` must be
|
85
|
+
# supplied. Supplying both or neither returns
|
86
|
+
# [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000
|
87
|
+
# characters.
|
88
|
+
# @!attribute [rw] text
|
89
|
+
# @return [::String]
|
90
|
+
# The raw text to be synthesized.
|
91
|
+
# @!attribute [rw] ssml
|
92
|
+
# @return [::String]
|
93
|
+
# The SSML document to be synthesized. The SSML document must be valid
|
94
|
+
# and well-formed. Otherwise the RPC will fail and return
|
95
|
+
# [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
|
96
|
+
# [SSML](/speech/text-to-speech/docs/ssml).
|
97
|
+
class SynthesisInput
|
98
|
+
include ::Google::Protobuf::MessageExts
|
99
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
100
|
+
end
|
101
|
+
|
102
|
+
# Description of which voice to use for a synthesis request.
|
103
|
+
# @!attribute [rw] language_code
|
104
|
+
# @return [::String]
|
105
|
+
# Required. The language (and potentially also the region) of the voice expressed as a
|
106
|
+
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
|
107
|
+
# "en-US". This should not include a script tag (e.g. use
|
108
|
+
# "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
|
109
|
+
# from the input provided in the SynthesisInput. The TTS service
|
110
|
+
# will use this parameter to help choose an appropriate voice. Note that
|
111
|
+
# the TTS service may choose a voice with a slightly different language code
|
112
|
+
# than the one selected; it may substitute a different region
|
113
|
+
# (e.g. using en-US rather than en-CA if there isn't a Canadian voice
|
114
|
+
# available), or even a different language, e.g. using "nb" (Norwegian
|
115
|
+
# Bokmal) instead of "no" (Norwegian)".
|
116
|
+
# @!attribute [rw] name
|
117
|
+
# @return [::String]
|
118
|
+
# The name of the voice. If not set, the service will choose a
|
119
|
+
# voice based on the other parameters such as language_code and gender.
|
120
|
+
# @!attribute [rw] ssml_gender
|
121
|
+
# @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender]
|
122
|
+
# The preferred gender of the voice. If not set, the service will
|
123
|
+
# choose a voice based on the other parameters such as language_code and
|
124
|
+
# name. Note that this is only a preference, not requirement; if a
|
125
|
+
# voice of the appropriate gender is not available, the synthesizer should
|
126
|
+
# substitute a voice with a different gender rather than failing the request.
|
127
|
+
class VoiceSelectionParams
|
128
|
+
include ::Google::Protobuf::MessageExts
|
129
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
130
|
+
end
|
131
|
+
|
132
|
+
# Description of audio data to be synthesized.
|
133
|
+
# @!attribute [rw] audio_encoding
|
134
|
+
# @return [::Google::Cloud::TextToSpeech::V1::AudioEncoding]
|
135
|
+
# Required. The format of the audio byte stream.
|
136
|
+
# @!attribute [rw] speaking_rate
|
137
|
+
# @return [::Float]
|
138
|
+
# Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
|
139
|
+
# the normal native speed supported by the specific voice. 2.0 is twice as
|
140
|
+
# fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
|
141
|
+
# speed. Any other values < 0.25 or > 4.0 will return an error.
|
142
|
+
# @!attribute [rw] pitch
|
143
|
+
# @return [::Float]
|
144
|
+
# Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
|
145
|
+
# increase 20 semitones from the original pitch. -20 means decrease 20
|
146
|
+
# semitones from the original pitch.
|
147
|
+
# @!attribute [rw] volume_gain_db
|
148
|
+
# @return [::Float]
|
149
|
+
# Optional. Input only. Volume gain (in dB) of the normal native volume
|
150
|
+
# supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
|
151
|
+
# set to a value of 0.0 (dB), will play at normal native signal amplitude. A
|
152
|
+
# value of -6.0 (dB) will play at approximately half the amplitude of the
|
153
|
+
# normal native signal amplitude. A value of +6.0 (dB) will play at
|
154
|
+
# approximately twice the amplitude of the normal native signal amplitude.
|
155
|
+
# Strongly recommend not to exceed +10 (dB) as there's usually no effective
|
156
|
+
# increase in loudness for any value greater than that.
|
157
|
+
# @!attribute [rw] sample_rate_hertz
|
158
|
+
# @return [::Integer]
|
159
|
+
# Optional. The synthesis sample rate (in hertz) for this audio. When this is
|
160
|
+
# specified in SynthesizeSpeechRequest, if this is different from the voice's
|
161
|
+
# natural sample rate, then the synthesizer will honor this request by
|
162
|
+
# converting to the desired sample rate (which might result in worse audio
|
163
|
+
# quality), unless the specified sample rate is not supported for the
|
164
|
+
# encoding chosen, in which case it will fail the request and return
|
165
|
+
# [google.rpc.Code.INVALID_ARGUMENT][].
|
166
|
+
# @!attribute [rw] effects_profile_id
|
167
|
+
# @return [::Array<::String>]
|
168
|
+
# Optional. Input only. An identifier which selects 'audio effects' profiles
|
169
|
+
# that are applied on (post synthesized) text to speech. Effects are applied
|
170
|
+
# on top of each other in the order they are given. See
|
171
|
+
# [audio
|
172
|
+
# profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
|
173
|
+
# current supported profile ids.
|
174
|
+
class AudioConfig
|
175
|
+
include ::Google::Protobuf::MessageExts
|
176
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
177
|
+
end
|
178
|
+
|
179
|
+
# The message returned to the client by the `SynthesizeSpeech` method.
|
180
|
+
# @!attribute [rw] audio_content
|
181
|
+
# @return [::String]
|
182
|
+
# The audio data bytes encoded as specified in the request, including the
|
183
|
+
# header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
|
184
|
+
# For LINEAR16 audio, we include the WAV header. Note: as
|
185
|
+
# with all bytes fields, protobuffers use a pure binary representation,
|
186
|
+
# whereas JSON representations use base64.
|
187
|
+
class SynthesizeSpeechResponse
|
188
|
+
include ::Google::Protobuf::MessageExts
|
189
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
190
|
+
end
|
191
|
+
|
192
|
+
# Gender of the voice as described in
|
193
|
+
# [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
|
194
|
+
module SsmlVoiceGender
|
195
|
+
# An unspecified gender.
|
196
|
+
# In VoiceSelectionParams, this means that the client doesn't care which
|
197
|
+
# gender the selected voice will have. In the Voice field of
|
198
|
+
# ListVoicesResponse, this may mean that the voice doesn't fit any of the
|
199
|
+
# other categories in this enum, or that the gender of the voice isn't known.
|
200
|
+
SSML_VOICE_GENDER_UNSPECIFIED = 0
|
201
|
+
|
202
|
+
# A male voice.
|
203
|
+
MALE = 1
|
204
|
+
|
205
|
+
# A female voice.
|
206
|
+
FEMALE = 2
|
207
|
+
|
208
|
+
# A gender-neutral voice.
|
209
|
+
NEUTRAL = 3
|
210
|
+
end
|
211
|
+
|
212
|
+
# Configuration to set up audio encoder. The encoding determines the output
|
213
|
+
# audio format that we'd like.
|
214
|
+
module AudioEncoding
|
215
|
+
# Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
|
216
|
+
AUDIO_ENCODING_UNSPECIFIED = 0
|
217
|
+
|
218
|
+
# Uncompressed 16-bit signed little-endian samples (Linear PCM).
|
219
|
+
# Audio content returned as LINEAR16 also contains a WAV header.
|
220
|
+
LINEAR16 = 1
|
221
|
+
|
222
|
+
# MP3 audio at 32kbps.
|
223
|
+
MP3 = 2
|
224
|
+
|
225
|
+
# Opus encoded audio wrapped in an ogg container. The result will be a
|
226
|
+
# file which can be played natively on Android, and in browsers (at least
|
227
|
+
# Chrome and Firefox). The quality of the encoding is considerably higher
|
228
|
+
# than MP3 while using approximately the same bitrate.
|
229
|
+
OGG_OPUS = 3
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-cloud-text_to_speech-v1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Google LLC
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gapic-common
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-cloud-errors
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: google-style
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.24.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.24.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.10'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.10'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '12.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '12.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: redcarpet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.18'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.18'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.9'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.9'
|
125
|
+
description: Text-to-Speech converts text or Speech Synthesis Markup Language (SSML)
|
126
|
+
input into audio data of natural human speech.
|
127
|
+
email: googleapis-packages@google.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".yardopts"
|
133
|
+
- AUTHENTICATION.md
|
134
|
+
- LICENSE.md
|
135
|
+
- README.md
|
136
|
+
- lib/google-cloud-text_to_speech-v1.rb
|
137
|
+
- lib/google/cloud/common_resources_pb.rb
|
138
|
+
- lib/google/cloud/text_to_speech/v1.rb
|
139
|
+
- lib/google/cloud/text_to_speech/v1/text_to_speech.rb
|
140
|
+
- lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb
|
141
|
+
- lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb
|
142
|
+
- lib/google/cloud/text_to_speech/v1/version.rb
|
143
|
+
- lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb
|
144
|
+
- lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb
|
145
|
+
- proto_docs/README.md
|
146
|
+
- proto_docs/google/api/field_behavior.rb
|
147
|
+
- proto_docs/google/api/resource.rb
|
148
|
+
- proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb
|
149
|
+
homepage: https://github.com/googleapis/google-cloud-ruby
|
150
|
+
licenses:
|
151
|
+
- Apache-2.0
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '2.4'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubygems_version: 3.0.6
|
169
|
+
signing_key:
|
170
|
+
specification_version: 4
|
171
|
+
summary: API Client library for the Cloud Text-to-Speech V1 API
|
172
|
+
test_files: []
|