@jambonz/speech-utils 0.0.1

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.
@@ -0,0 +1,1278 @@
1
+ // source: riva/proto/riva_tts.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global = Function('return this')();
17
+
18
+ var riva_proto_riva_audio_pb = require('../../riva/proto/riva_audio_pb.js');
19
+ goog.object.extend(proto, riva_proto_riva_audio_pb);
20
+ goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigRequest', null, global);
21
+ goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigResponse', null, global);
22
+ goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config', null, global);
23
+ goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechRequest', null, global);
24
+ goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechResponse', null, global);
25
+ goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata', null, global);
26
+ /**
27
+ * Generated by JsPbCodeGenerator.
28
+ * @param {Array=} opt_data Optional initial data array, typically from a
29
+ * server response, or constructed directly in Javascript. The array is used
30
+ * in place and becomes part of the constructed object. It is not cloned.
31
+ * If no data is provided, the constructed object will be empty, but still
32
+ * valid.
33
+ * @extends {jspb.Message}
34
+ * @constructor
35
+ */
36
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest = function(opt_data) {
37
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
38
+ };
39
+ goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigRequest, jspb.Message);
40
+ if (goog.DEBUG && !COMPILED) {
41
+ /**
42
+ * @public
43
+ * @override
44
+ */
45
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigRequest';
46
+ }
47
+ /**
48
+ * Generated by JsPbCodeGenerator.
49
+ * @param {Array=} opt_data Optional initial data array, typically from a
50
+ * server response, or constructed directly in Javascript. The array is used
51
+ * in place and becomes part of the constructed object. It is not cloned.
52
+ * If no data is provided, the constructed object will be empty, but still
53
+ * valid.
54
+ * @extends {jspb.Message}
55
+ * @constructor
56
+ */
57
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse = function(opt_data) {
58
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.repeatedFields_, null);
59
+ };
60
+ goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigResponse, jspb.Message);
61
+ if (goog.DEBUG && !COMPILED) {
62
+ /**
63
+ * @public
64
+ * @override
65
+ */
66
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigResponse';
67
+ }
68
+ /**
69
+ * Generated by JsPbCodeGenerator.
70
+ * @param {Array=} opt_data Optional initial data array, typically from a
71
+ * server response, or constructed directly in Javascript. The array is used
72
+ * in place and becomes part of the constructed object. It is not cloned.
73
+ * If no data is provided, the constructed object will be empty, but still
74
+ * valid.
75
+ * @extends {jspb.Message}
76
+ * @constructor
77
+ */
78
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config = function(opt_data) {
79
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
80
+ };
81
+ goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, jspb.Message);
82
+ if (goog.DEBUG && !COMPILED) {
83
+ /**
84
+ * @public
85
+ * @override
86
+ */
87
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config';
88
+ }
89
+ /**
90
+ * Generated by JsPbCodeGenerator.
91
+ * @param {Array=} opt_data Optional initial data array, typically from a
92
+ * server response, or constructed directly in Javascript. The array is used
93
+ * in place and becomes part of the constructed object. It is not cloned.
94
+ * If no data is provided, the constructed object will be empty, but still
95
+ * valid.
96
+ * @extends {jspb.Message}
97
+ * @constructor
98
+ */
99
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest = function(opt_data) {
100
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
101
+ };
102
+ goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechRequest, jspb.Message);
103
+ if (goog.DEBUG && !COMPILED) {
104
+ /**
105
+ * @public
106
+ * @override
107
+ */
108
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechRequest';
109
+ }
110
+ /**
111
+ * Generated by JsPbCodeGenerator.
112
+ * @param {Array=} opt_data Optional initial data array, typically from a
113
+ * server response, or constructed directly in Javascript. The array is used
114
+ * in place and becomes part of the constructed object. It is not cloned.
115
+ * If no data is provided, the constructed object will be empty, but still
116
+ * valid.
117
+ * @extends {jspb.Message}
118
+ * @constructor
119
+ */
120
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata = function(opt_data) {
121
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.repeatedFields_, null);
122
+ };
123
+ goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata, jspb.Message);
124
+ if (goog.DEBUG && !COMPILED) {
125
+ /**
126
+ * @public
127
+ * @override
128
+ */
129
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata';
130
+ }
131
+ /**
132
+ * Generated by JsPbCodeGenerator.
133
+ * @param {Array=} opt_data Optional initial data array, typically from a
134
+ * server response, or constructed directly in Javascript. The array is used
135
+ * in place and becomes part of the constructed object. It is not cloned.
136
+ * If no data is provided, the constructed object will be empty, but still
137
+ * valid.
138
+ * @extends {jspb.Message}
139
+ * @constructor
140
+ */
141
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse = function(opt_data) {
142
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
143
+ };
144
+ goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechResponse, jspb.Message);
145
+ if (goog.DEBUG && !COMPILED) {
146
+ /**
147
+ * @public
148
+ * @override
149
+ */
150
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechResponse';
151
+ }
152
+
153
+
154
+
155
+ if (jspb.Message.GENERATE_TO_OBJECT) {
156
+ /**
157
+ * Creates an object representation of this proto.
158
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
159
+ * Optional fields that are not set will be set to undefined.
160
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
161
+ * For the list of reserved names please see:
162
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
163
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
164
+ * JSPB instance for transitional soy proto support:
165
+ * http://goto/soy-param-migration
166
+ * @return {!Object}
167
+ */
168
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.toObject = function(opt_includeInstance) {
169
+ return proto.nvidia.riva.tts.RivaSynthesisConfigRequest.toObject(opt_includeInstance, this);
170
+ };
171
+
172
+
173
+ /**
174
+ * Static version of the {@see toObject} method.
175
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
176
+ * the JSPB instance for transitional soy proto support:
177
+ * http://goto/soy-param-migration
178
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} msg The msg instance to transform.
179
+ * @return {!Object}
180
+ * @suppress {unusedLocalVariables} f is only used for nested messages
181
+ */
182
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.toObject = function(includeInstance, msg) {
183
+ var f, obj = {
184
+ modelName: jspb.Message.getFieldWithDefault(msg, 1, "")
185
+ };
186
+
187
+ if (includeInstance) {
188
+ obj.$jspbMessageInstance = msg;
189
+ }
190
+ return obj;
191
+ };
192
+ }
193
+
194
+
195
+ /**
196
+ * Deserializes binary data (in protobuf wire format).
197
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
198
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest}
199
+ */
200
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinary = function(bytes) {
201
+ var reader = new jspb.BinaryReader(bytes);
202
+ var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigRequest;
203
+ return proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinaryFromReader(msg, reader);
204
+ };
205
+
206
+
207
+ /**
208
+ * Deserializes binary data (in protobuf wire format) from the
209
+ * given reader into the given message object.
210
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} msg The message object to deserialize into.
211
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
212
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest}
213
+ */
214
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinaryFromReader = function(msg, reader) {
215
+ while (reader.nextField()) {
216
+ if (reader.isEndGroup()) {
217
+ break;
218
+ }
219
+ var field = reader.getFieldNumber();
220
+ switch (field) {
221
+ case 1:
222
+ var value = /** @type {string} */ (reader.readString());
223
+ msg.setModelName(value);
224
+ break;
225
+ default:
226
+ reader.skipField();
227
+ break;
228
+ }
229
+ }
230
+ return msg;
231
+ };
232
+
233
+
234
+ /**
235
+ * Serializes the message to binary data (in protobuf wire format).
236
+ * @return {!Uint8Array}
237
+ */
238
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.serializeBinary = function() {
239
+ var writer = new jspb.BinaryWriter();
240
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.serializeBinaryToWriter(this, writer);
241
+ return writer.getResultBuffer();
242
+ };
243
+
244
+
245
+ /**
246
+ * Serializes the given message to binary data (in protobuf wire
247
+ * format), writing to the given BinaryWriter.
248
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} message
249
+ * @param {!jspb.BinaryWriter} writer
250
+ * @suppress {unusedLocalVariables} f is only used for nested messages
251
+ */
252
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.serializeBinaryToWriter = function(message, writer) {
253
+ var f = undefined;
254
+ f = message.getModelName();
255
+ if (f.length > 0) {
256
+ writer.writeString(
257
+ 1,
258
+ f
259
+ );
260
+ }
261
+ };
262
+
263
+
264
+ /**
265
+ * optional string model_name = 1;
266
+ * @return {string}
267
+ */
268
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.getModelName = function() {
269
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
270
+ };
271
+
272
+
273
+ /**
274
+ * @param {string} value
275
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} returns this
276
+ */
277
+ proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.setModelName = function(value) {
278
+ return jspb.Message.setProto3StringField(this, 1, value);
279
+ };
280
+
281
+
282
+
283
+ /**
284
+ * List of repeated fields within this message type.
285
+ * @private {!Array<number>}
286
+ * @const
287
+ */
288
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.repeatedFields_ = [1];
289
+
290
+
291
+
292
+ if (jspb.Message.GENERATE_TO_OBJECT) {
293
+ /**
294
+ * Creates an object representation of this proto.
295
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
296
+ * Optional fields that are not set will be set to undefined.
297
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
298
+ * For the list of reserved names please see:
299
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
300
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
301
+ * JSPB instance for transitional soy proto support:
302
+ * http://goto/soy-param-migration
303
+ * @return {!Object}
304
+ */
305
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.toObject = function(opt_includeInstance) {
306
+ return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.toObject(opt_includeInstance, this);
307
+ };
308
+
309
+
310
+ /**
311
+ * Static version of the {@see toObject} method.
312
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
313
+ * the JSPB instance for transitional soy proto support:
314
+ * http://goto/soy-param-migration
315
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} msg The msg instance to transform.
316
+ * @return {!Object}
317
+ * @suppress {unusedLocalVariables} f is only used for nested messages
318
+ */
319
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.toObject = function(includeInstance, msg) {
320
+ var f, obj = {
321
+ modelConfigList: jspb.Message.toObjectList(msg.getModelConfigList(),
322
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject, includeInstance)
323
+ };
324
+
325
+ if (includeInstance) {
326
+ obj.$jspbMessageInstance = msg;
327
+ }
328
+ return obj;
329
+ };
330
+ }
331
+
332
+
333
+ /**
334
+ * Deserializes binary data (in protobuf wire format).
335
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
336
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse}
337
+ */
338
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinary = function(bytes) {
339
+ var reader = new jspb.BinaryReader(bytes);
340
+ var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse;
341
+ return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinaryFromReader(msg, reader);
342
+ };
343
+
344
+
345
+ /**
346
+ * Deserializes binary data (in protobuf wire format) from the
347
+ * given reader into the given message object.
348
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} msg The message object to deserialize into.
349
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
350
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse}
351
+ */
352
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinaryFromReader = function(msg, reader) {
353
+ while (reader.nextField()) {
354
+ if (reader.isEndGroup()) {
355
+ break;
356
+ }
357
+ var field = reader.getFieldNumber();
358
+ switch (field) {
359
+ case 1:
360
+ var value = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config;
361
+ reader.readMessage(value,proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader);
362
+ msg.addModelConfig(value);
363
+ break;
364
+ default:
365
+ reader.skipField();
366
+ break;
367
+ }
368
+ }
369
+ return msg;
370
+ };
371
+
372
+
373
+ /**
374
+ * Serializes the message to binary data (in protobuf wire format).
375
+ * @return {!Uint8Array}
376
+ */
377
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.serializeBinary = function() {
378
+ var writer = new jspb.BinaryWriter();
379
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.serializeBinaryToWriter(this, writer);
380
+ return writer.getResultBuffer();
381
+ };
382
+
383
+
384
+ /**
385
+ * Serializes the given message to binary data (in protobuf wire
386
+ * format), writing to the given BinaryWriter.
387
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} message
388
+ * @param {!jspb.BinaryWriter} writer
389
+ * @suppress {unusedLocalVariables} f is only used for nested messages
390
+ */
391
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.serializeBinaryToWriter = function(message, writer) {
392
+ var f = undefined;
393
+ f = message.getModelConfigList();
394
+ if (f.length > 0) {
395
+ writer.writeRepeatedMessage(
396
+ 1,
397
+ f,
398
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter
399
+ );
400
+ }
401
+ };
402
+
403
+
404
+
405
+
406
+
407
+ if (jspb.Message.GENERATE_TO_OBJECT) {
408
+ /**
409
+ * Creates an object representation of this proto.
410
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
411
+ * Optional fields that are not set will be set to undefined.
412
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
413
+ * For the list of reserved names please see:
414
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
415
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
416
+ * JSPB instance for transitional soy proto support:
417
+ * http://goto/soy-param-migration
418
+ * @return {!Object}
419
+ */
420
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.toObject = function(opt_includeInstance) {
421
+ return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject(opt_includeInstance, this);
422
+ };
423
+
424
+
425
+ /**
426
+ * Static version of the {@see toObject} method.
427
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
428
+ * the JSPB instance for transitional soy proto support:
429
+ * http://goto/soy-param-migration
430
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} msg The msg instance to transform.
431
+ * @return {!Object}
432
+ * @suppress {unusedLocalVariables} f is only used for nested messages
433
+ */
434
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject = function(includeInstance, msg) {
435
+ var f, obj = {
436
+ modelName: jspb.Message.getFieldWithDefault(msg, 1, ""),
437
+ parametersMap: (f = msg.getParametersMap()) ? f.toObject(includeInstance, undefined) : []
438
+ };
439
+
440
+ if (includeInstance) {
441
+ obj.$jspbMessageInstance = msg;
442
+ }
443
+ return obj;
444
+ };
445
+ }
446
+
447
+
448
+ /**
449
+ * Deserializes binary data (in protobuf wire format).
450
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
451
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config}
452
+ */
453
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinary = function(bytes) {
454
+ var reader = new jspb.BinaryReader(bytes);
455
+ var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config;
456
+ return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader(msg, reader);
457
+ };
458
+
459
+
460
+ /**
461
+ * Deserializes binary data (in protobuf wire format) from the
462
+ * given reader into the given message object.
463
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} msg The message object to deserialize into.
464
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
465
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config}
466
+ */
467
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader = function(msg, reader) {
468
+ while (reader.nextField()) {
469
+ if (reader.isEndGroup()) {
470
+ break;
471
+ }
472
+ var field = reader.getFieldNumber();
473
+ switch (field) {
474
+ case 1:
475
+ var value = /** @type {string} */ (reader.readString());
476
+ msg.setModelName(value);
477
+ break;
478
+ case 2:
479
+ var value = msg.getParametersMap();
480
+ reader.readMessage(value, function(message, reader) {
481
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
482
+ });
483
+ break;
484
+ default:
485
+ reader.skipField();
486
+ break;
487
+ }
488
+ }
489
+ return msg;
490
+ };
491
+
492
+
493
+ /**
494
+ * Serializes the message to binary data (in protobuf wire format).
495
+ * @return {!Uint8Array}
496
+ */
497
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.serializeBinary = function() {
498
+ var writer = new jspb.BinaryWriter();
499
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter(this, writer);
500
+ return writer.getResultBuffer();
501
+ };
502
+
503
+
504
+ /**
505
+ * Serializes the given message to binary data (in protobuf wire
506
+ * format), writing to the given BinaryWriter.
507
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} message
508
+ * @param {!jspb.BinaryWriter} writer
509
+ * @suppress {unusedLocalVariables} f is only used for nested messages
510
+ */
511
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter = function(message, writer) {
512
+ var f = undefined;
513
+ f = message.getModelName();
514
+ if (f.length > 0) {
515
+ writer.writeString(
516
+ 1,
517
+ f
518
+ );
519
+ }
520
+ f = message.getParametersMap(true);
521
+ if (f && f.getLength() > 0) {
522
+ f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
523
+ }
524
+ };
525
+
526
+
527
+ /**
528
+ * optional string model_name = 1;
529
+ * @return {string}
530
+ */
531
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.getModelName = function() {
532
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
533
+ };
534
+
535
+
536
+ /**
537
+ * @param {string} value
538
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} returns this
539
+ */
540
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.setModelName = function(value) {
541
+ return jspb.Message.setProto3StringField(this, 1, value);
542
+ };
543
+
544
+
545
+ /**
546
+ * map<string, string> parameters = 2;
547
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
548
+ * empty, instead returning `undefined`
549
+ * @return {!jspb.Map<string,string>}
550
+ */
551
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.getParametersMap = function(opt_noLazyCreate) {
552
+ return /** @type {!jspb.Map<string,string>} */ (
553
+ jspb.Message.getMapField(this, 2, opt_noLazyCreate,
554
+ null));
555
+ };
556
+
557
+
558
+ /**
559
+ * Clears values from the map. The map will be non-null.
560
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} returns this
561
+ */
562
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.clearParametersMap = function() {
563
+ this.getParametersMap().clear();
564
+ return this;};
565
+
566
+
567
+ /**
568
+ * repeated Config model_config = 1;
569
+ * @return {!Array<!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config>}
570
+ */
571
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.getModelConfigList = function() {
572
+ return /** @type{!Array<!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config>} */ (
573
+ jspb.Message.getRepeatedWrapperField(this, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, 1));
574
+ };
575
+
576
+
577
+ /**
578
+ * @param {!Array<!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config>} value
579
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} returns this
580
+ */
581
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.setModelConfigList = function(value) {
582
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
583
+ };
584
+
585
+
586
+ /**
587
+ * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config=} opt_value
588
+ * @param {number=} opt_index
589
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config}
590
+ */
591
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.addModelConfig = function(opt_value, opt_index) {
592
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, opt_index);
593
+ };
594
+
595
+
596
+ /**
597
+ * Clears the list making it empty but non-null.
598
+ * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} returns this
599
+ */
600
+ proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.clearModelConfigList = function() {
601
+ return this.setModelConfigList([]);
602
+ };
603
+
604
+
605
+
606
+
607
+
608
+ if (jspb.Message.GENERATE_TO_OBJECT) {
609
+ /**
610
+ * Creates an object representation of this proto.
611
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
612
+ * Optional fields that are not set will be set to undefined.
613
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
614
+ * For the list of reserved names please see:
615
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
616
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
617
+ * JSPB instance for transitional soy proto support:
618
+ * http://goto/soy-param-migration
619
+ * @return {!Object}
620
+ */
621
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.toObject = function(opt_includeInstance) {
622
+ return proto.nvidia.riva.tts.SynthesizeSpeechRequest.toObject(opt_includeInstance, this);
623
+ };
624
+
625
+
626
+ /**
627
+ * Static version of the {@see toObject} method.
628
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
629
+ * the JSPB instance for transitional soy proto support:
630
+ * http://goto/soy-param-migration
631
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} msg The msg instance to transform.
632
+ * @return {!Object}
633
+ * @suppress {unusedLocalVariables} f is only used for nested messages
634
+ */
635
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.toObject = function(includeInstance, msg) {
636
+ var f, obj = {
637
+ text: jspb.Message.getFieldWithDefault(msg, 1, ""),
638
+ languageCode: jspb.Message.getFieldWithDefault(msg, 2, ""),
639
+ encoding: jspb.Message.getFieldWithDefault(msg, 3, 0),
640
+ sampleRateHz: jspb.Message.getFieldWithDefault(msg, 4, 0),
641
+ voiceName: jspb.Message.getFieldWithDefault(msg, 5, "")
642
+ };
643
+
644
+ if (includeInstance) {
645
+ obj.$jspbMessageInstance = msg;
646
+ }
647
+ return obj;
648
+ };
649
+ }
650
+
651
+
652
+ /**
653
+ * Deserializes binary data (in protobuf wire format).
654
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
655
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest}
656
+ */
657
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinary = function(bytes) {
658
+ var reader = new jspb.BinaryReader(bytes);
659
+ var msg = new proto.nvidia.riva.tts.SynthesizeSpeechRequest;
660
+ return proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinaryFromReader(msg, reader);
661
+ };
662
+
663
+
664
+ /**
665
+ * Deserializes binary data (in protobuf wire format) from the
666
+ * given reader into the given message object.
667
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} msg The message object to deserialize into.
668
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
669
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest}
670
+ */
671
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinaryFromReader = function(msg, reader) {
672
+ while (reader.nextField()) {
673
+ if (reader.isEndGroup()) {
674
+ break;
675
+ }
676
+ var field = reader.getFieldNumber();
677
+ switch (field) {
678
+ case 1:
679
+ var value = /** @type {string} */ (reader.readString());
680
+ msg.setText(value);
681
+ break;
682
+ case 2:
683
+ var value = /** @type {string} */ (reader.readString());
684
+ msg.setLanguageCode(value);
685
+ break;
686
+ case 3:
687
+ var value = /** @type {!proto.nvidia.riva.AudioEncoding} */ (reader.readEnum());
688
+ msg.setEncoding(value);
689
+ break;
690
+ case 4:
691
+ var value = /** @type {number} */ (reader.readInt32());
692
+ msg.setSampleRateHz(value);
693
+ break;
694
+ case 5:
695
+ var value = /** @type {string} */ (reader.readString());
696
+ msg.setVoiceName(value);
697
+ break;
698
+ default:
699
+ reader.skipField();
700
+ break;
701
+ }
702
+ }
703
+ return msg;
704
+ };
705
+
706
+
707
+ /**
708
+ * Serializes the message to binary data (in protobuf wire format).
709
+ * @return {!Uint8Array}
710
+ */
711
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.serializeBinary = function() {
712
+ var writer = new jspb.BinaryWriter();
713
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.serializeBinaryToWriter(this, writer);
714
+ return writer.getResultBuffer();
715
+ };
716
+
717
+
718
+ /**
719
+ * Serializes the given message to binary data (in protobuf wire
720
+ * format), writing to the given BinaryWriter.
721
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} message
722
+ * @param {!jspb.BinaryWriter} writer
723
+ * @suppress {unusedLocalVariables} f is only used for nested messages
724
+ */
725
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.serializeBinaryToWriter = function(message, writer) {
726
+ var f = undefined;
727
+ f = message.getText();
728
+ if (f.length > 0) {
729
+ writer.writeString(
730
+ 1,
731
+ f
732
+ );
733
+ }
734
+ f = message.getLanguageCode();
735
+ if (f.length > 0) {
736
+ writer.writeString(
737
+ 2,
738
+ f
739
+ );
740
+ }
741
+ f = message.getEncoding();
742
+ if (f !== 0.0) {
743
+ writer.writeEnum(
744
+ 3,
745
+ f
746
+ );
747
+ }
748
+ f = message.getSampleRateHz();
749
+ if (f !== 0) {
750
+ writer.writeInt32(
751
+ 4,
752
+ f
753
+ );
754
+ }
755
+ f = message.getVoiceName();
756
+ if (f.length > 0) {
757
+ writer.writeString(
758
+ 5,
759
+ f
760
+ );
761
+ }
762
+ };
763
+
764
+
765
+ /**
766
+ * optional string text = 1;
767
+ * @return {string}
768
+ */
769
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getText = function() {
770
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
771
+ };
772
+
773
+
774
+ /**
775
+ * @param {string} value
776
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this
777
+ */
778
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setText = function(value) {
779
+ return jspb.Message.setProto3StringField(this, 1, value);
780
+ };
781
+
782
+
783
+ /**
784
+ * optional string language_code = 2;
785
+ * @return {string}
786
+ */
787
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getLanguageCode = function() {
788
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
789
+ };
790
+
791
+
792
+ /**
793
+ * @param {string} value
794
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this
795
+ */
796
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setLanguageCode = function(value) {
797
+ return jspb.Message.setProto3StringField(this, 2, value);
798
+ };
799
+
800
+
801
+ /**
802
+ * optional nvidia.riva.AudioEncoding encoding = 3;
803
+ * @return {!proto.nvidia.riva.AudioEncoding}
804
+ */
805
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getEncoding = function() {
806
+ return /** @type {!proto.nvidia.riva.AudioEncoding} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
807
+ };
808
+
809
+
810
+ /**
811
+ * @param {!proto.nvidia.riva.AudioEncoding} value
812
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this
813
+ */
814
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setEncoding = function(value) {
815
+ return jspb.Message.setProto3EnumField(this, 3, value);
816
+ };
817
+
818
+
819
+ /**
820
+ * optional int32 sample_rate_hz = 4;
821
+ * @return {number}
822
+ */
823
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getSampleRateHz = function() {
824
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
825
+ };
826
+
827
+
828
+ /**
829
+ * @param {number} value
830
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this
831
+ */
832
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setSampleRateHz = function(value) {
833
+ return jspb.Message.setProto3IntField(this, 4, value);
834
+ };
835
+
836
+
837
+ /**
838
+ * optional string voice_name = 5;
839
+ * @return {string}
840
+ */
841
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getVoiceName = function() {
842
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
843
+ };
844
+
845
+
846
+ /**
847
+ * @param {string} value
848
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this
849
+ */
850
+ proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setVoiceName = function(value) {
851
+ return jspb.Message.setProto3StringField(this, 5, value);
852
+ };
853
+
854
+
855
+
856
+ /**
857
+ * List of repeated fields within this message type.
858
+ * @private {!Array<number>}
859
+ * @const
860
+ */
861
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.repeatedFields_ = [8];
862
+
863
+
864
+
865
+ if (jspb.Message.GENERATE_TO_OBJECT) {
866
+ /**
867
+ * Creates an object representation of this proto.
868
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
869
+ * Optional fields that are not set will be set to undefined.
870
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
871
+ * For the list of reserved names please see:
872
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
873
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
874
+ * JSPB instance for transitional soy proto support:
875
+ * http://goto/soy-param-migration
876
+ * @return {!Object}
877
+ */
878
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.toObject = function(opt_includeInstance) {
879
+ return proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject(opt_includeInstance, this);
880
+ };
881
+
882
+
883
+ /**
884
+ * Static version of the {@see toObject} method.
885
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
886
+ * the JSPB instance for transitional soy proto support:
887
+ * http://goto/soy-param-migration
888
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} msg The msg instance to transform.
889
+ * @return {!Object}
890
+ * @suppress {unusedLocalVariables} f is only used for nested messages
891
+ */
892
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject = function(includeInstance, msg) {
893
+ var f, obj = {
894
+ text: jspb.Message.getFieldWithDefault(msg, 1, ""),
895
+ processedText: jspb.Message.getFieldWithDefault(msg, 2, ""),
896
+ predictedDurationsList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 8)) == null ? undefined : f
897
+ };
898
+
899
+ if (includeInstance) {
900
+ obj.$jspbMessageInstance = msg;
901
+ }
902
+ return obj;
903
+ };
904
+ }
905
+
906
+
907
+ /**
908
+ * Deserializes binary data (in protobuf wire format).
909
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
910
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata}
911
+ */
912
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinary = function(bytes) {
913
+ var reader = new jspb.BinaryReader(bytes);
914
+ var msg = new proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata;
915
+ return proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader(msg, reader);
916
+ };
917
+
918
+
919
+ /**
920
+ * Deserializes binary data (in protobuf wire format) from the
921
+ * given reader into the given message object.
922
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} msg The message object to deserialize into.
923
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
924
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata}
925
+ */
926
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader = function(msg, reader) {
927
+ while (reader.nextField()) {
928
+ if (reader.isEndGroup()) {
929
+ break;
930
+ }
931
+ var field = reader.getFieldNumber();
932
+ switch (field) {
933
+ case 1:
934
+ var value = /** @type {string} */ (reader.readString());
935
+ msg.setText(value);
936
+ break;
937
+ case 2:
938
+ var value = /** @type {string} */ (reader.readString());
939
+ msg.setProcessedText(value);
940
+ break;
941
+ case 8:
942
+ var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]);
943
+ for (var i = 0; i < values.length; i++) {
944
+ msg.addPredictedDurations(values[i]);
945
+ }
946
+ break;
947
+ default:
948
+ reader.skipField();
949
+ break;
950
+ }
951
+ }
952
+ return msg;
953
+ };
954
+
955
+
956
+ /**
957
+ * Serializes the message to binary data (in protobuf wire format).
958
+ * @return {!Uint8Array}
959
+ */
960
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.serializeBinary = function() {
961
+ var writer = new jspb.BinaryWriter();
962
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter(this, writer);
963
+ return writer.getResultBuffer();
964
+ };
965
+
966
+
967
+ /**
968
+ * Serializes the given message to binary data (in protobuf wire
969
+ * format), writing to the given BinaryWriter.
970
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} message
971
+ * @param {!jspb.BinaryWriter} writer
972
+ * @suppress {unusedLocalVariables} f is only used for nested messages
973
+ */
974
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter = function(message, writer) {
975
+ var f = undefined;
976
+ f = message.getText();
977
+ if (f.length > 0) {
978
+ writer.writeString(
979
+ 1,
980
+ f
981
+ );
982
+ }
983
+ f = message.getProcessedText();
984
+ if (f.length > 0) {
985
+ writer.writeString(
986
+ 2,
987
+ f
988
+ );
989
+ }
990
+ f = message.getPredictedDurationsList();
991
+ if (f.length > 0) {
992
+ writer.writePackedFloat(
993
+ 8,
994
+ f
995
+ );
996
+ }
997
+ };
998
+
999
+
1000
+ /**
1001
+ * optional string text = 1;
1002
+ * @return {string}
1003
+ */
1004
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getText = function() {
1005
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1006
+ };
1007
+
1008
+
1009
+ /**
1010
+ * @param {string} value
1011
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this
1012
+ */
1013
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setText = function(value) {
1014
+ return jspb.Message.setProto3StringField(this, 1, value);
1015
+ };
1016
+
1017
+
1018
+ /**
1019
+ * optional string processed_text = 2;
1020
+ * @return {string}
1021
+ */
1022
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getProcessedText = function() {
1023
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1024
+ };
1025
+
1026
+
1027
+ /**
1028
+ * @param {string} value
1029
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this
1030
+ */
1031
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setProcessedText = function(value) {
1032
+ return jspb.Message.setProto3StringField(this, 2, value);
1033
+ };
1034
+
1035
+
1036
+ /**
1037
+ * repeated float predicted_durations = 8;
1038
+ * @return {!Array<number>}
1039
+ */
1040
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getPredictedDurationsList = function() {
1041
+ return /** @type {!Array<number>} */ (jspb.Message.getRepeatedFloatingPointField(this, 8));
1042
+ };
1043
+
1044
+
1045
+ /**
1046
+ * @param {!Array<number>} value
1047
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this
1048
+ */
1049
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setPredictedDurationsList = function(value) {
1050
+ return jspb.Message.setField(this, 8, value || []);
1051
+ };
1052
+
1053
+
1054
+ /**
1055
+ * @param {number} value
1056
+ * @param {number=} opt_index
1057
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this
1058
+ */
1059
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.addPredictedDurations = function(value, opt_index) {
1060
+ return jspb.Message.addToRepeatedField(this, 8, value, opt_index);
1061
+ };
1062
+
1063
+
1064
+ /**
1065
+ * Clears the list making it empty but non-null.
1066
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this
1067
+ */
1068
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.clearPredictedDurationsList = function() {
1069
+ return this.setPredictedDurationsList([]);
1070
+ };
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1077
+ /**
1078
+ * Creates an object representation of this proto.
1079
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1080
+ * Optional fields that are not set will be set to undefined.
1081
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1082
+ * For the list of reserved names please see:
1083
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1084
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1085
+ * JSPB instance for transitional soy proto support:
1086
+ * http://goto/soy-param-migration
1087
+ * @return {!Object}
1088
+ */
1089
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.toObject = function(opt_includeInstance) {
1090
+ return proto.nvidia.riva.tts.SynthesizeSpeechResponse.toObject(opt_includeInstance, this);
1091
+ };
1092
+
1093
+
1094
+ /**
1095
+ * Static version of the {@see toObject} method.
1096
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1097
+ * the JSPB instance for transitional soy proto support:
1098
+ * http://goto/soy-param-migration
1099
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} msg The msg instance to transform.
1100
+ * @return {!Object}
1101
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1102
+ */
1103
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.toObject = function(includeInstance, msg) {
1104
+ var f, obj = {
1105
+ audio: msg.getAudio_asB64(),
1106
+ meta: (f = msg.getMeta()) && proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject(includeInstance, f)
1107
+ };
1108
+
1109
+ if (includeInstance) {
1110
+ obj.$jspbMessageInstance = msg;
1111
+ }
1112
+ return obj;
1113
+ };
1114
+ }
1115
+
1116
+
1117
+ /**
1118
+ * Deserializes binary data (in protobuf wire format).
1119
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1120
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse}
1121
+ */
1122
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinary = function(bytes) {
1123
+ var reader = new jspb.BinaryReader(bytes);
1124
+ var msg = new proto.nvidia.riva.tts.SynthesizeSpeechResponse;
1125
+ return proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinaryFromReader(msg, reader);
1126
+ };
1127
+
1128
+
1129
+ /**
1130
+ * Deserializes binary data (in protobuf wire format) from the
1131
+ * given reader into the given message object.
1132
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} msg The message object to deserialize into.
1133
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1134
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse}
1135
+ */
1136
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinaryFromReader = function(msg, reader) {
1137
+ while (reader.nextField()) {
1138
+ if (reader.isEndGroup()) {
1139
+ break;
1140
+ }
1141
+ var field = reader.getFieldNumber();
1142
+ switch (field) {
1143
+ case 1:
1144
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
1145
+ msg.setAudio(value);
1146
+ break;
1147
+ case 2:
1148
+ var value = new proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata;
1149
+ reader.readMessage(value,proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader);
1150
+ msg.setMeta(value);
1151
+ break;
1152
+ default:
1153
+ reader.skipField();
1154
+ break;
1155
+ }
1156
+ }
1157
+ return msg;
1158
+ };
1159
+
1160
+
1161
+ /**
1162
+ * Serializes the message to binary data (in protobuf wire format).
1163
+ * @return {!Uint8Array}
1164
+ */
1165
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.serializeBinary = function() {
1166
+ var writer = new jspb.BinaryWriter();
1167
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.serializeBinaryToWriter(this, writer);
1168
+ return writer.getResultBuffer();
1169
+ };
1170
+
1171
+
1172
+ /**
1173
+ * Serializes the given message to binary data (in protobuf wire
1174
+ * format), writing to the given BinaryWriter.
1175
+ * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} message
1176
+ * @param {!jspb.BinaryWriter} writer
1177
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1178
+ */
1179
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.serializeBinaryToWriter = function(message, writer) {
1180
+ var f = undefined;
1181
+ f = message.getAudio_asU8();
1182
+ if (f.length > 0) {
1183
+ writer.writeBytes(
1184
+ 1,
1185
+ f
1186
+ );
1187
+ }
1188
+ f = message.getMeta();
1189
+ if (f != null) {
1190
+ writer.writeMessage(
1191
+ 2,
1192
+ f,
1193
+ proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter
1194
+ );
1195
+ }
1196
+ };
1197
+
1198
+
1199
+ /**
1200
+ * optional bytes audio = 1;
1201
+ * @return {!(string|Uint8Array)}
1202
+ */
1203
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio = function() {
1204
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1205
+ };
1206
+
1207
+
1208
+ /**
1209
+ * optional bytes audio = 1;
1210
+ * This is a type-conversion wrapper around `getAudio()`
1211
+ * @return {string}
1212
+ */
1213
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio_asB64 = function() {
1214
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
1215
+ this.getAudio()));
1216
+ };
1217
+
1218
+
1219
+ /**
1220
+ * optional bytes audio = 1;
1221
+ * Note that Uint8Array is not supported on all browsers.
1222
+ * @see http://caniuse.com/Uint8Array
1223
+ * This is a type-conversion wrapper around `getAudio()`
1224
+ * @return {!Uint8Array}
1225
+ */
1226
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio_asU8 = function() {
1227
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1228
+ this.getAudio()));
1229
+ };
1230
+
1231
+
1232
+ /**
1233
+ * @param {!(string|Uint8Array)} value
1234
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this
1235
+ */
1236
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.setAudio = function(value) {
1237
+ return jspb.Message.setProto3BytesField(this, 1, value);
1238
+ };
1239
+
1240
+
1241
+ /**
1242
+ * optional SynthesizeSpeechResponseMetadata meta = 2;
1243
+ * @return {?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata}
1244
+ */
1245
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getMeta = function() {
1246
+ return /** @type{?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} */ (
1247
+ jspb.Message.getWrapperField(this, proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata, 2));
1248
+ };
1249
+
1250
+
1251
+ /**
1252
+ * @param {?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata|undefined} value
1253
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this
1254
+ */
1255
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.setMeta = function(value) {
1256
+ return jspb.Message.setWrapperField(this, 2, value);
1257
+ };
1258
+
1259
+
1260
+ /**
1261
+ * Clears the message field making it undefined.
1262
+ * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this
1263
+ */
1264
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.clearMeta = function() {
1265
+ return this.setMeta(undefined);
1266
+ };
1267
+
1268
+
1269
+ /**
1270
+ * Returns whether this field is set.
1271
+ * @return {boolean}
1272
+ */
1273
+ proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.hasMeta = function() {
1274
+ return jspb.Message.getField(this, 2) != null;
1275
+ };
1276
+
1277
+
1278
+ goog.object.extend(exports, proto.nvidia.riva.tts);