google-cloud-speech 0.24.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36b97feadc80ff3fb73b37650feeb33ac875030f
4
- data.tar.gz: 653975eca064e0e00a4d42c42b5296bdf5efd073
3
+ metadata.gz: ccecf5215ecbd7fd0e0ef074b7638711905b8450
4
+ data.tar.gz: f4c270117ad7bc3611e435fb598b5dd6bcbc835c
5
5
  SHA512:
6
- metadata.gz: e07b99125ff4f79b79a5676ebe0ba321a46d26ef7f27fe0f779a4676f91176520820ae5328c3e9f56324918745f95fa1399cab16b142bbc24aab06f1b1005b70
7
- data.tar.gz: 5708a7d8aff0e3152179315ce5be6bb18bd04d0df5538f24ed822bfcd28e719aee436eaaea7dde3289f505f8136b7ae5a9232b9eafdd1e221b3b16565767eb0e
6
+ metadata.gz: d034fa22e135e05a08e14b09ffc2cb075a5cd7757f717a7635bfbd551539d853935670664c21cd636f1b2f2bd68da0d769f2747c8f7b0002b79628d49360197e
7
+ data.tar.gz: 5b3101e327dbb801a311abc8cc0dcaf2ec3774cce69c22f8bd629fff62701bc9ab7b8717ef4b923dc0c95d0d4d3efb32642fd876d0d0dbe91cb4d99a0ed0fb0d
data/README.md CHANGED
@@ -26,7 +26,7 @@ require "google/cloud/speech"
26
26
  speech = Google::Cloud::Speech.new
27
27
 
28
28
  audio = speech.audio "path/to/audio.raw",
29
- encoding: :raw,
29
+ encoding: :linear16,
30
30
  language: "en-US",
31
31
  sample_rate: 16000
32
32
 
@@ -51,7 +51,7 @@ module Google
51
51
  # speech = gcloud.speech
52
52
  #
53
53
  # audio = speech.audio "path/to/audio.raw",
54
- # encoding: :raw,
54
+ # encoding: :linear16,
55
55
  # language: "en-US",
56
56
  # sample_rate: 16000
57
57
  #
@@ -99,7 +99,7 @@ module Google
99
99
  # speech = Google::Cloud.speech
100
100
  #
101
101
  # audio = speech.audio "path/to/audio.raw",
102
- # encoding: :raw,
102
+ # encoding: :linear16,
103
103
  # language: "en-US",
104
104
  # sample_rate: 16000
105
105
  #
@@ -56,7 +56,7 @@ module Google
56
56
  # speech = Google::Cloud::Speech.new
57
57
  #
58
58
  # audio = speech.audio "path/to/audio.raw",
59
- # encoding: :raw,
59
+ # encoding: :linear16,
60
60
  # language: "en-US",
61
61
  # sample_rate: 16000
62
62
  # ```
@@ -69,7 +69,7 @@ module Google
69
69
  # speech = Google::Cloud::Speech.new
70
70
  #
71
71
  # audio = speech.audio "gs://bucket-name/path/to/audio.raw",
72
- # encoding: :raw,
72
+ # encoding: :linear16,
73
73
  # language: "en-US",
74
74
  # sample_rate: 16000
75
75
  # ```
@@ -89,7 +89,7 @@ module Google
89
89
  # speech = Google::Cloud::Speech.new
90
90
  #
91
91
  # audio = speech.audio file,
92
- # encoding: :raw,
92
+ # encoding: :linear16,
93
93
  # language: "en-US",
94
94
  # sample_rate: 16000
95
95
  # ```
@@ -112,7 +112,7 @@ module Google
112
112
  # speech = Google::Cloud::Speech.new
113
113
  #
114
114
  # audio = speech.audio "path/to/audio.raw",
115
- # encoding: :raw,
115
+ # encoding: :linear16,
116
116
  # language: "en-US",
117
117
  # sample_rate: 16000
118
118
  #
@@ -133,7 +133,7 @@ module Google
133
133
  # speech = Google::Cloud::Speech.new
134
134
  #
135
135
  # audio = speech.audio "path/to/audio.raw",
136
- # encoding: :raw,
136
+ # encoding: :linear16,
137
137
  # language: "en-US",
138
138
  # sample_rate: 16000
139
139
  #
@@ -160,7 +160,7 @@ module Google
160
160
  #
161
161
  # audio = speech.audio "path/to/audio.raw"
162
162
  #
163
- # stream = audio.stream encoding: :raw,
163
+ # stream = audio.stream encoding: :linear16,
164
164
  # language: "en-US",
165
165
  # sample_rate: 16000
166
166
  #
@@ -215,19 +215,23 @@ module Google
215
215
  # speech = Google::Cloud::Speech.new
216
216
  #
217
217
  # audio = speech.audio "path/to/audio.raw",
218
- # encoding: :raw,
218
+ # encoding: :linear16,
219
219
  # language: "en-US",
220
220
  # sample_rate: 16000
221
221
  #
222
222
  def self.new project: nil, keyfile: nil, scope: nil, timeout: nil,
223
223
  client_config: nil
224
224
  project ||= Google::Cloud::Speech::Project.default_project
225
+ project = project.to_s # Always cast to a string
226
+ fail ArgumentError, "project is missing" if project.empty?
227
+
225
228
  if keyfile.nil?
226
229
  credentials = Google::Cloud::Speech::Credentials.default scope: scope
227
230
  else
228
231
  credentials = Google::Cloud::Speech::Credentials.new(
229
232
  keyfile, scope: scope)
230
233
  end
234
+
231
235
  Google::Cloud::Speech::Project.new(
232
236
  Google::Cloud::Speech::Service.new(
233
237
  project, credentials, timeout: timeout,
@@ -39,7 +39,7 @@ module Google
39
39
  # speech = Google::Cloud::Speech.new
40
40
  #
41
41
  # audio = speech.audio "path/to/audio.raw",
42
- # encoding: :raw,
42
+ # encoding: :linear16,
43
43
  # language: "en-US",
44
44
  # sample_rate: 16000
45
45
  #
@@ -59,7 +59,7 @@ module Google
59
59
  #
60
60
  # Acceptable values are:
61
61
  #
62
- # * `raw` - Uncompressed 16-bit signed little-endian samples.
62
+ # * `linear16` - Uncompressed 16-bit signed little-endian samples.
63
63
  # (LINEAR16)
64
64
  # * `flac` - The [Free Lossless Audio
65
65
  # Codec](http://flac.sourceforge.net/documentation.html) encoding.
@@ -92,8 +92,8 @@ module Google
92
92
  # language: "en-US",
93
93
  # sample_rate: 16000
94
94
  #
95
- # audio.encoding = :raw
96
- # audio.encoding #=> :raw
95
+ # audio.encoding = :linear16
96
+ # audio.encoding #=> :linear16
97
97
  #
98
98
  attr_accessor :encoding
99
99
 
@@ -113,7 +113,7 @@ module Google
113
113
  # speech = Google::Cloud::Speech.new
114
114
  #
115
115
  # audio = speech.audio "path/to/audio.raw",
116
- # encoding: :raw,
116
+ # encoding: :linear16,
117
117
  # sample_rate: 16000
118
118
  #
119
119
  # audio.language = "en-US"
@@ -135,7 +135,7 @@ module Google
135
135
  # speech = Google::Cloud::Speech.new
136
136
  #
137
137
  # audio = speech.audio "path/to/audio.raw",
138
- # encoding: :raw,
138
+ # encoding: :linear16,
139
139
  # language: "en-US"
140
140
  #
141
141
  # audio.sample_rate = 16000
@@ -200,7 +200,7 @@ module Google
200
200
  # speech = Google::Cloud::Speech.new
201
201
  #
202
202
  # audio = speech.audio "path/to/audio.raw",
203
- # encoding: :raw,
203
+ # encoding: :linear16,
204
204
  # language: "en-US",
205
205
  # sample_rate: 16000
206
206
  #
@@ -249,7 +249,7 @@ module Google
249
249
  # speech = Google::Cloud::Speech.new
250
250
  #
251
251
  # audio = speech.audio "path/to/audio.raw",
252
- # encoding: :raw,
252
+ # encoding: :linear16,
253
253
  # language: "en-US",
254
254
  # sample_rate: 16000
255
255
  #
@@ -39,9 +39,9 @@ module Google
39
39
  # speech = Google::Cloud::Speech.new
40
40
  #
41
41
  # op = speech.process "path/to/audio.raw",
42
- # encoding: :raw,
43
- # language: "en-US",
44
- # sample_rate: 16000
42
+ # encoding: :linear16,
43
+ # language: "en-US",
44
+ # sample_rate: 16000
45
45
  #
46
46
  # op.done? #=> false
47
47
  # op.reload! # API call
@@ -70,7 +70,7 @@ module Google
70
70
  # speech = Google::Cloud::Speech.new
71
71
  #
72
72
  # op = speech.process "path/to/audio.raw",
73
- # encoding: :raw,
73
+ # encoding: :linear16,
74
74
  # language: "en-US",
75
75
  # sample_rate: 16000
76
76
  #
@@ -92,7 +92,7 @@ module Google
92
92
  # speech = Google::Cloud::Speech.new
93
93
  #
94
94
  # op = speech.process "path/to/audio.raw",
95
- # encoding: :raw,
95
+ # encoding: :linear16,
96
96
  # language: "en-US",
97
97
  # sample_rate: 16000
98
98
  #
@@ -114,7 +114,7 @@ module Google
114
114
  # speech = Google::Cloud::Speech.new
115
115
  #
116
116
  # op = speech.process "path/to/audio.raw",
117
- # encoding: :raw,
117
+ # encoding: :linear16,
118
118
  # language: "en-US",
119
119
  # sample_rate: 16000
120
120
  #
@@ -141,7 +141,7 @@ module Google
141
141
  # speech = Google::Cloud::Speech.new
142
142
  #
143
143
  # op = speech.process "path/to/audio.raw",
144
- # encoding: :raw,
144
+ # encoding: :linear16,
145
145
  # language: "en-US",
146
146
  # sample_rate: 16000
147
147
  #
@@ -165,7 +165,7 @@ module Google
165
165
  # speech = Google::Cloud::Speech.new
166
166
  #
167
167
  # op = speech.process "path/to/audio.raw",
168
- # encoding: :raw,
168
+ # encoding: :linear16,
169
169
  # language: "en-US",
170
170
  # sample_rate: 16000
171
171
  #
@@ -190,7 +190,7 @@ module Google
190
190
  # speech = Google::Cloud::Speech.new
191
191
  #
192
192
  # op = speech.process "path/to/audio.raw",
193
- # encoding: :raw,
193
+ # encoding: :linear16,
194
194
  # language: "en-US",
195
195
  # sample_rate: 16000
196
196
  #
@@ -212,7 +212,7 @@ module Google
212
212
  # speech = Google::Cloud::Speech.new
213
213
  #
214
214
  # op = speech.process "path/to/audio.raw",
215
- # encoding: :raw,
215
+ # encoding: :linear16,
216
216
  # language: "en-US",
217
217
  # sample_rate: 16000
218
218
  #
@@ -236,7 +236,7 @@ module Google
236
236
  # speech = Google::Cloud::Speech.new
237
237
  #
238
238
  # op = speech.process "path/to/audio.raw",
239
- # encoding: :raw,
239
+ # encoding: :linear16,
240
240
  # language: "en-US",
241
241
  # sample_rate: 16000
242
242
  #
@@ -44,7 +44,7 @@ module Google
44
44
  # speech = Google::Cloud::Speech.new
45
45
  #
46
46
  # audio = speech.audio "path/to/audio.raw",
47
- # encoding: :raw,
47
+ # encoding: :linear16,
48
48
  # language: "en-US",
49
49
  # sample_rate: 16000
50
50
  # results = audio.recognize
@@ -110,7 +110,7 @@ module Google
110
110
  #
111
111
  # Acceptable values are:
112
112
  #
113
- # * `raw` - Uncompressed 16-bit signed little-endian samples.
113
+ # * `linear16` - Uncompressed 16-bit signed little-endian samples.
114
114
  # (LINEAR16)
115
115
  # * `flac` - The [Free Lossless Audio
116
116
  # Codec](http://flac.sourceforge.net/documentation.html) encoding.
@@ -152,7 +152,7 @@ module Google
152
152
  # speech = Google::Cloud::Speech.new
153
153
  #
154
154
  # audio = speech.audio "path/to/audio.raw",
155
- # encoding: :raw,
155
+ # encoding: :linear16,
156
156
  # language: "en-US",
157
157
  # sample_rate: 16000
158
158
  #
@@ -162,7 +162,7 @@ module Google
162
162
  # speech = Google::Cloud::Speech.new
163
163
  #
164
164
  # audio = speech.audio "gs://bucket-name/path/to/audio.raw",
165
- # encoding: :raw,
165
+ # encoding: :linear16,
166
166
  # language: "en-US",
167
167
  # sample_rate: 16000
168
168
  #
@@ -179,7 +179,7 @@ module Google
179
179
  # speech = Google::Cloud::Speech.new
180
180
  #
181
181
  # audio = speech.audio file,
182
- # encoding: :raw,
182
+ # encoding: :linear16,
183
183
  # language: "en-US",
184
184
  # sample_rate: 16000
185
185
  #
@@ -222,7 +222,7 @@ module Google
222
222
  #
223
223
  # Acceptable values are:
224
224
  #
225
- # * `raw` - Uncompressed 16-bit signed little-endian samples.
225
+ # * `linear16` - Uncompressed 16-bit signed little-endian samples.
226
226
  # (LINEAR16)
227
227
  # * `flac` - The [Free Lossless Audio
228
228
  # Codec](http://flac.sourceforge.net/documentation.html) encoding.
@@ -275,7 +275,7 @@ module Google
275
275
  # speech = Google::Cloud::Speech.new
276
276
  #
277
277
  # results = speech.recognize "path/to/audio.raw",
278
- # encoding: :raw,
278
+ # encoding: :linear16,
279
279
  # language: "en-US",
280
280
  # sample_rate: 16000
281
281
  #
@@ -285,7 +285,7 @@ module Google
285
285
  # speech = Google::Cloud::Speech.new
286
286
  #
287
287
  # results = speech.recognize "gs://bucket-name/path/to/audio.raw",
288
- # encoding: :raw,
288
+ # encoding: :linear16,
289
289
  # language: "en-US",
290
290
  # sample_rate: 16000
291
291
  #
@@ -302,7 +302,7 @@ module Google
302
302
  # speech = Google::Cloud::Speech.new
303
303
  #
304
304
  # results = speech.recognize file,
305
- # encoding: :raw,
305
+ # encoding: :linear16,
306
306
  # language: "en-US",
307
307
  # sample_rate: 16000,
308
308
  # max_alternatives: 10
@@ -344,7 +344,7 @@ module Google
344
344
  #
345
345
  # Acceptable values are:
346
346
  #
347
- # * `raw` - Uncompressed 16-bit signed little-endian samples.
347
+ # * `linear16` - Uncompressed 16-bit signed little-endian samples.
348
348
  # (LINEAR16)
349
349
  # * `flac` - The [Free Lossless Audio
350
350
  # Codec](http://flac.sourceforge.net/documentation.html) encoding.
@@ -398,7 +398,7 @@ module Google
398
398
  # speech = Google::Cloud::Speech.new
399
399
  #
400
400
  # op = speech.process "path/to/audio.raw",
401
- # encoding: :raw,
401
+ # encoding: :linear16,
402
402
  # language: "en-US",
403
403
  # sample_rate: 16000
404
404
  #
@@ -411,9 +411,9 @@ module Google
411
411
  # speech = Google::Cloud::Speech.new
412
412
  #
413
413
  # op = speech.process "gs://bucket-name/path/to/audio.raw",
414
- # encoding: :raw,
415
- # language: "en-US",
416
- # sample_rate: 16000
414
+ # encoding: :linear16,
415
+ # language: "en-US",
416
+ # sample_rate: 16000
417
417
  #
418
418
  # op.done? #=> false
419
419
  # op.reload!
@@ -431,10 +431,10 @@ module Google
431
431
  # speech = Google::Cloud::Speech.new
432
432
  #
433
433
  # op = speech.process file,
434
- # encoding: :raw,
435
- # language: "en-US",
436
- # sample_rate: 16000,
437
- # max_alternatives: 10
434
+ # encoding: :linear16,
435
+ # language: "en-US",
436
+ # sample_rate: 16000,
437
+ # max_alternatives: 10
438
438
  #
439
439
  # op.done? #=> false
440
440
  # op.reload!
@@ -469,7 +469,7 @@ module Google
469
469
  #
470
470
  # Acceptable values are:
471
471
  #
472
- # * `raw` - Uncompressed 16-bit signed little-endian samples.
472
+ # * `linear16` - Uncompressed 16-bit signed little-endian samples.
473
473
  # (LINEAR16)
474
474
  # * `flac` - The [Free Lossless Audio
475
475
  # Codec](http://flac.sourceforge.net/documentation.html) encoding.
@@ -530,7 +530,7 @@ module Google
530
530
  #
531
531
  # speech = Google::Cloud::Speech.new
532
532
  #
533
- # stream = speech.stream encoding: :raw,
533
+ # stream = speech.stream encoding: :linear16,
534
534
  # language: "en-US",
535
535
  # sample_rate: 16000
536
536
  #
@@ -623,7 +623,7 @@ module Google
623
623
  end
624
624
 
625
625
  def convert_encoding encoding
626
- mapping = { raw: :LINEAR16, linear: :LINEAR16, linear16: :LINEAR16,
626
+ mapping = { linear: :LINEAR16, linear16: :LINEAR16,
627
627
  flac: :FLAC, mulaw: :MULAW, amr: :AMR, amr_wb: :AMR_WB,
628
628
  ogg_opus: :OGG_OPUS, speex: :SPEEX_WITH_HEADER_BYTE }
629
629
  mapping[encoding] || encoding
@@ -46,7 +46,7 @@ module Google
46
46
  # speech = Google::Cloud::Speech.new
47
47
  #
48
48
  # audio = speech.audio "path/to/audio.raw",
49
- # encoding: :raw,
49
+ # encoding: :linear16,
50
50
  # language: "en-US",
51
51
  # sample_rate: 16000
52
52
  # results = audio.recognize
@@ -96,7 +96,7 @@ module Google
96
96
  # speech = Google::Cloud::Speech.new
97
97
  #
98
98
  # audio = speech.audio "path/to/audio.raw",
99
- # encoding: :raw,
99
+ # encoding: :linear16,
100
100
  # language: "en-US",
101
101
  # sample_rate: 16000
102
102
  # results = audio.recognize
@@ -154,7 +154,7 @@ module Google
154
154
  #
155
155
  # speech = Google::Cloud::Speech.new
156
156
  #
157
- # stream = speech.stream encoding: :raw,
157
+ # stream = speech.stream encoding: :linear16,
158
158
  # language: "en-US",
159
159
  # sample_rate: 16000
160
160
  #
@@ -31,7 +31,7 @@ module Google
31
31
  #
32
32
  # speech = Google::Cloud::Speech.new
33
33
  #
34
- # stream = speech.stream encoding: :raw,
34
+ # stream = speech.stream encoding: :linear16,
35
35
  # language: "en-US",
36
36
  # sample_rate: 16000
37
37
  #
@@ -96,7 +96,7 @@ module Google
96
96
  #
97
97
  # audio = speech.audio "path/to/audio.raw"
98
98
  #
99
- # stream = speech.stream encoding: :raw,
99
+ # stream = speech.stream encoding: :linear16,
100
100
  # language: "en-US",
101
101
  # sample_rate: 16000
102
102
  #
@@ -155,7 +155,7 @@ module Google
155
155
  #
156
156
  # speech = Google::Cloud::Speech.new
157
157
  #
158
- # stream = speech.stream encoding: :raw,
158
+ # stream = speech.stream encoding: :linear16,
159
159
  # language: "en-US",
160
160
  # sample_rate: 16000
161
161
  #
@@ -189,7 +189,7 @@ module Google
189
189
  #
190
190
  # speech = Google::Cloud::Speech.new
191
191
  #
192
- # stream = speech.stream encoding: :raw,
192
+ # stream = speech.stream encoding: :linear16,
193
193
  # language: "en-US",
194
194
  # sample_rate: 16000
195
195
  #
@@ -224,7 +224,7 @@ module Google
224
224
  #
225
225
  # speech = Google::Cloud::Speech.new
226
226
  #
227
- # stream = speech.stream encoding: :raw,
227
+ # stream = speech.stream encoding: :linear16,
228
228
  # language: "en-US",
229
229
  # sample_rate: 16000
230
230
  #
@@ -266,7 +266,7 @@ module Google
266
266
  #
267
267
  # speech = Google::Cloud::Speech.new
268
268
  #
269
- # stream = speech.stream encoding: :raw,
269
+ # stream = speech.stream encoding: :linear16,
270
270
  # language: "en-US",
271
271
  # sample_rate: 16000
272
272
  #
@@ -312,7 +312,7 @@ module Google
312
312
  #
313
313
  # speech = Google::Cloud::Speech.new
314
314
  #
315
- # stream = speech.stream encoding: :raw,
315
+ # stream = speech.stream encoding: :linear16,
316
316
  # language: "en-US",
317
317
  # sample_rate: 16000
318
318
  #
@@ -357,7 +357,7 @@ module Google
357
357
  #
358
358
  # speech = Google::Cloud::Speech.new
359
359
  #
360
- # stream = speech.stream encoding: :raw,
360
+ # stream = speech.stream encoding: :linear16,
361
361
  # language: "en-US",
362
362
  # sample_rate: 16000
363
363
  #
@@ -404,7 +404,7 @@ module Google
404
404
  #
405
405
  # speech = Google::Cloud::Speech.new
406
406
  #
407
- # stream = speech.stream encoding: :raw,
407
+ # stream = speech.stream encoding: :linear16,
408
408
  # language: "en-US",
409
409
  # sample_rate: 16000,
410
410
  # utterance: true
@@ -449,7 +449,7 @@ module Google
449
449
  #
450
450
  # speech = Google::Cloud::Speech.new
451
451
  #
452
- # stream = speech.stream encoding: :raw,
452
+ # stream = speech.stream encoding: :linear16,
453
453
  # language: "en-US",
454
454
  # sample_rate: 16000
455
455
  #
@@ -6,9 +6,7 @@
6
6
  "DEADLINE_EXCEEDED",
7
7
  "UNAVAILABLE"
8
8
  ],
9
- "non_idempotent": [
10
- "UNAVAILABLE"
11
- ]
9
+ "non_idempotent": []
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Speech
19
- VERSION = "0.24.0"
19
+ VERSION = "0.25.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-05 00:00:00.000000000 Z
12
+ date: 2017-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -194,7 +194,7 @@ files:
194
194
  - lib/google/cloud/speech/v1/speech_client.rb
195
195
  - lib/google/cloud/speech/v1/speech_client_config.json
196
196
  - lib/google/cloud/speech/version.rb
197
- homepage: http://googlecloudplatform.github.io/google-cloud-ruby/
197
+ homepage: https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/google-cloud-speech
198
198
  licenses:
199
199
  - Apache-2.0
200
200
  metadata: {}
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.6.11
217
+ rubygems_version: 2.6.12
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: API Client library for Google Cloud Speech API