google-cloud-text_to_speech 0.3.1 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f3471981322f80cfa00c192c8152334adb139da4f3af2f0fa0296a1cd244eea
4
- data.tar.gz: 7e909c187531b28c55332c4a0d625904161e7b5a5ceba2158d358c727a561bb4
3
+ metadata.gz: f25a09e52fffd9d3e3f7864eccebc81fcea03fedb91667fc4765ec0127f48f6b
4
+ data.tar.gz: 52375ae1d683e3b9fb8defd27227dcffcc26ba53d61905aeb1802d3c524f0d17
5
5
  SHA512:
6
- metadata.gz: 4a5918e7638d40b30f2c2206e895ceae2b0b3f1a2d6770d960efd72dd08693607d02640475b14c4d712d5d587220d996f259251d9fec6213e0cd8321ca6251da
7
- data.tar.gz: 6d10bbfbf8f65f04c640a657feb8031e52ef70aff7fb1ad8914fbe50071103b58ac8ca21a45809ba2848abb8fcb45b9209408dd8af50ea81c54af47e38f24d01
6
+ metadata.gz: fb285a68655384f8906c38ea30c43718394a80aa73538206665cb6d65d4007c5eec28059d7bef863faa8e584b5f276188c72471d791198bc469c7e3e74174e0c
7
+ data.tar.gz: 41cc193bb8028358c2a9749a7c2e6bddcdfbccc51724135fc67556e259a87ef42064d5f6136b93b48e7c627d32055953f795b2a83f62360d9f3f5a0d8f6c812b
data/README.md CHANGED
@@ -33,6 +33,7 @@ voice = { language_code: language_code }
33
33
  audio_encoding = :MP3
34
34
  audio_config = { audio_encoding: audio_encoding }
35
35
  response = text_to_speech_client.synthesize_speech(input, voice, audio_config)
36
+ File.write("example.mp3", response.audio_content, mode: "wb")
36
37
  ```
37
38
 
38
39
  ### Next Steps
@@ -135,6 +135,10 @@ module Google
135
135
  # The default timeout, in seconds, for calls made through this client.
136
136
  # @param metadata [Hash]
137
137
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
138
+ # @param service_address [String]
139
+ # Override for the service hostname, or `nil` to leave as the default.
140
+ # @param service_port [Integer]
141
+ # Override for the service port, or `nil` to leave as the default.
138
142
  # @param exception_transformer [Proc]
139
143
  # An optional proc that intercepts any exceptions raised during an API call to inject
140
144
  # custom error handling.
@@ -123,6 +123,10 @@ module Google
123
123
  # The default timeout, in seconds, for calls made through this client.
124
124
  # @param metadata [Hash]
125
125
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
126
+ # @param service_address [String]
127
+ # Override for the service hostname, or `nil` to leave as the default.
128
+ # @param service_port [Integer]
129
+ # Override for the service port, or `nil` to leave as the default.
126
130
  # @param exception_transformer [Proc]
127
131
  # An optional proc that intercepts any exceptions raised during an API call to inject
128
132
  # custom error handling.
@@ -132,6 +136,8 @@ module Google
132
136
  client_config: nil,
133
137
  timeout: nil,
134
138
  metadata: nil,
139
+ service_address: nil,
140
+ service_port: nil,
135
141
  exception_transformer: nil,
136
142
  lib_name: nil,
137
143
  lib_version: nil
@@ -143,6 +149,8 @@ module Google
143
149
  metadata: metadata,
144
150
  exception_transformer: exception_transformer,
145
151
  lib_name: lib_name,
152
+ service_address: service_address,
153
+ service_port: service_port,
146
154
  lib_version: lib_version
147
155
  }.select { |_, v| v != nil }
148
156
  Google::Cloud::TextToSpeech::V1::TextToSpeechClient.new(**kwargs)
@@ -85,6 +85,10 @@ module Google
85
85
  # The default timeout, in seconds, for calls made through this client.
86
86
  # @param metadata [Hash]
87
87
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
88
+ # @param service_address [String]
89
+ # Override for the service hostname, or `nil` to leave as the default.
90
+ # @param service_port [Integer]
91
+ # Override for the service port, or `nil` to leave as the default.
88
92
  # @param exception_transformer [Proc]
89
93
  # An optional proc that intercepts any exceptions raised during an API call to inject
90
94
  # custom error handling.
@@ -94,6 +98,8 @@ module Google
94
98
  client_config: {},
95
99
  timeout: DEFAULT_TIMEOUT,
96
100
  metadata: nil,
101
+ service_address: nil,
102
+ service_port: nil,
97
103
  exception_transformer: nil,
98
104
  lib_name: nil,
99
105
  lib_version: ""
@@ -147,8 +153,8 @@ module Google
147
153
  end
148
154
 
149
155
  # Allow overriding the service path/port in subclasses.
150
- service_path = self.class::SERVICE_ADDRESS
151
- port = self.class::DEFAULT_SERVICE_PORT
156
+ service_path = service_address || self.class::SERVICE_ADDRESS
157
+ port = service_port || self.class::DEFAULT_SERVICE_PORT
152
158
  interceptors = self.class::GRPC_INTERCEPTORS
153
159
  @text_to_speech_stub = Google::Gax::Grpc.create_stub(
154
160
  service_path,
@@ -123,6 +123,10 @@ module Google
123
123
  # The default timeout, in seconds, for calls made through this client.
124
124
  # @param metadata [Hash]
125
125
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
126
+ # @param service_address [String]
127
+ # Override for the service hostname, or `nil` to leave as the default.
128
+ # @param service_port [Integer]
129
+ # Override for the service port, or `nil` to leave as the default.
126
130
  # @param exception_transformer [Proc]
127
131
  # An optional proc that intercepts any exceptions raised during an API call to inject
128
132
  # custom error handling.
@@ -132,6 +136,8 @@ module Google
132
136
  client_config: nil,
133
137
  timeout: nil,
134
138
  metadata: nil,
139
+ service_address: nil,
140
+ service_port: nil,
135
141
  exception_transformer: nil,
136
142
  lib_name: nil,
137
143
  lib_version: nil
@@ -143,6 +149,8 @@ module Google
143
149
  metadata: metadata,
144
150
  exception_transformer: exception_transformer,
145
151
  lib_name: lib_name,
152
+ service_address: service_address,
153
+ service_port: service_port,
146
154
  lib_version: lib_version
147
155
  }.select { |_, v| v != nil }
148
156
  Google::Cloud::TextToSpeech::V1beta1::TextToSpeechClient.new(**kwargs)
@@ -85,6 +85,10 @@ module Google
85
85
  # The default timeout, in seconds, for calls made through this client.
86
86
  # @param metadata [Hash]
87
87
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
88
+ # @param service_address [String]
89
+ # Override for the service hostname, or `nil` to leave as the default.
90
+ # @param service_port [Integer]
91
+ # Override for the service port, or `nil` to leave as the default.
88
92
  # @param exception_transformer [Proc]
89
93
  # An optional proc that intercepts any exceptions raised during an API call to inject
90
94
  # custom error handling.
@@ -94,6 +98,8 @@ module Google
94
98
  client_config: {},
95
99
  timeout: DEFAULT_TIMEOUT,
96
100
  metadata: nil,
101
+ service_address: nil,
102
+ service_port: nil,
97
103
  exception_transformer: nil,
98
104
  lib_name: nil,
99
105
  lib_version: ""
@@ -147,8 +153,8 @@ module Google
147
153
  end
148
154
 
149
155
  # Allow overriding the service path/port in subclasses.
150
- service_path = self.class::SERVICE_ADDRESS
151
- port = self.class::DEFAULT_SERVICE_PORT
156
+ service_path = service_address || self.class::SERVICE_ADDRESS
157
+ port = service_port || self.class::DEFAULT_SERVICE_PORT
152
158
  interceptors = self.class::GRPC_INTERCEPTORS
153
159
  @text_to_speech_stub = Google::Gax::Grpc.create_stub(
154
160
  service_path,
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module TextToSpeech
19
- VERSION = "0.3.1".freeze
19
+ VERSION = "0.4.0".freeze
20
20
  end
21
21
  end
22
22
  end
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: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2019-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '1.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement