google-cloud-text_to_speech 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIGRATING.md +51 -0
- data/lib/google/cloud/text_to_speech/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7644a242f0fdb02d68e4fd6ecd7a56b8787e28b693e8ac5a6c6b74ec8fdf9abf
|
4
|
+
data.tar.gz: fe457fd08ebdc624063122203c4e906d63cc89f33eaff67f4ad220c7352fa02c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad9950862c86f20a973d1b487154da13dc82cc970423e1b5970107ba31a88172393b80e617a05f14bb0a8bf8bda64b99c8f2c2d175fb6aeb1e89af40399c7a01
|
7
|
+
data.tar.gz: e0f94c1b174c911c64e99b14e24ff0c97425c78e542be2fd352d73c2ee60fa5a56b72bc07352f6af05a2abc03a5fc96df8d1c88eda8057453513de38bd644574
|
data/MIGRATING.md
CHANGED
@@ -26,6 +26,10 @@ To summarize:
|
|
26
26
|
specifies whether they are required or optional. Additionally, you can pass
|
27
27
|
a proto request object instead of separate arguments. See
|
28
28
|
[Passing Arguments](#passing-arguments) for more info.
|
29
|
+
* Previously, clients reported RPC errors by raising instances of
|
30
|
+
`Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
|
31
|
+
`Google::Cloud::Error` and its subclasses. See
|
32
|
+
[Handling Errors](#handling-errors) for more info.
|
29
33
|
* Some classes have moved into different namespaces. See
|
30
34
|
[Class Namespaces](#class-namespaces) for more info.
|
31
35
|
|
@@ -207,6 +211,53 @@ response = client.synthesize_speech(
|
|
207
211
|
)
|
208
212
|
```
|
209
213
|
|
214
|
+
### Handling Errors
|
215
|
+
|
216
|
+
The client reports standard
|
217
|
+
[gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
|
218
|
+
by raising exceptions. In older releases, these exceptions were located in the
|
219
|
+
`Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
|
220
|
+
exception class, defined in the `google-gax` gem. However, these classes were
|
221
|
+
different from the standard exceptions (subclasses of `Google::Cloud::Error`)
|
222
|
+
thrown by other client libraries such as `google-cloud-storage`.
|
223
|
+
|
224
|
+
The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
|
225
|
+
for consistency across all the Google Cloud client libraries. In general, these
|
226
|
+
exceptions have the same name as their counterparts from older releases, but
|
227
|
+
are located in the `Google::Cloud` namespace rather than the `Google::Gax`
|
228
|
+
namespace.
|
229
|
+
|
230
|
+
Old:
|
231
|
+
```
|
232
|
+
client = Google::Cloud::TextToSpeech.new
|
233
|
+
|
234
|
+
input = { text: "Hello, world!" }
|
235
|
+
voice = { language_code: "en-US" }
|
236
|
+
audio = { audio_encoding: Google::Cloud::Texttospeech::V1::AudioEncoding::MP3 }
|
237
|
+
|
238
|
+
begin
|
239
|
+
response = client.synthesize_speech input, voice, audio
|
240
|
+
rescue Google::Gax::Error => e
|
241
|
+
# Handle exceptions that subclass Google::Gax::Error
|
242
|
+
end
|
243
|
+
```
|
244
|
+
|
245
|
+
New:
|
246
|
+
```
|
247
|
+
client = Google::Cloud::TextToSpeech.text_to_speech
|
248
|
+
|
249
|
+
input = { text: "Hello, world!" }
|
250
|
+
voice = { language_code: "en-US" }
|
251
|
+
audio = { audio_encoding: Google::Cloud::TextToSpeech::V1::AudioEncoding::MP3 }
|
252
|
+
|
253
|
+
begin
|
254
|
+
response = client.synthesize_speech input: input, voice: voice,
|
255
|
+
audio_config: audio
|
256
|
+
rescue Google::Cloud::Error => e
|
257
|
+
# Handle exceptions that subclass Google::Cloud::Error
|
258
|
+
end
|
259
|
+
```
|
260
|
+
|
210
261
|
### Class Namespaces
|
211
262
|
|
212
263
|
In older releases, some data type (protobuf) classes were located under the module
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-text_to_speech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|