• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/texttospeech/v1/cloud_tts.proto
18 
19 package com.google.cloud.texttospeech.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Description of audio data to be synthesized.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.texttospeech.v1.AudioConfig}
29  */
30 public final class AudioConfig extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.AudioConfig)
33     AudioConfigOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use AudioConfig.newBuilder() to construct.
AudioConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private AudioConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
AudioConfig()40   private AudioConfig() {
41     audioEncoding_ = 0;
42     effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new AudioConfig();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.cloud.texttospeech.v1.TextToSpeechProto
58         .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.texttospeech.v1.TextToSpeechProto
65         .internal_static_google_cloud_texttospeech_v1_AudioConfig_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.texttospeech.v1.AudioConfig.class,
68             com.google.cloud.texttospeech.v1.AudioConfig.Builder.class);
69   }
70 
71   public static final int AUDIO_ENCODING_FIELD_NUMBER = 1;
72   private int audioEncoding_ = 0;
73   /**
74    *
75    *
76    * <pre>
77    * Required. The format of the audio byte stream.
78    * </pre>
79    *
80    * <code>
81    * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
82    * </code>
83    *
84    * @return The enum numeric value on the wire for audioEncoding.
85    */
86   @java.lang.Override
getAudioEncodingValue()87   public int getAudioEncodingValue() {
88     return audioEncoding_;
89   }
90   /**
91    *
92    *
93    * <pre>
94    * Required. The format of the audio byte stream.
95    * </pre>
96    *
97    * <code>
98    * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
99    * </code>
100    *
101    * @return The audioEncoding.
102    */
103   @java.lang.Override
getAudioEncoding()104   public com.google.cloud.texttospeech.v1.AudioEncoding getAudioEncoding() {
105     com.google.cloud.texttospeech.v1.AudioEncoding result =
106         com.google.cloud.texttospeech.v1.AudioEncoding.forNumber(audioEncoding_);
107     return result == null ? com.google.cloud.texttospeech.v1.AudioEncoding.UNRECOGNIZED : result;
108   }
109 
110   public static final int SPEAKING_RATE_FIELD_NUMBER = 2;
111   private double speakingRate_ = 0D;
112   /**
113    *
114    *
115    * <pre>
116    * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
117    * the normal native speed supported by the specific voice. 2.0 is twice as
118    * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
119    * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
120    * </pre>
121    *
122    * <code>
123    * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
124    * </code>
125    *
126    * @return The speakingRate.
127    */
128   @java.lang.Override
getSpeakingRate()129   public double getSpeakingRate() {
130     return speakingRate_;
131   }
132 
133   public static final int PITCH_FIELD_NUMBER = 3;
134   private double pitch_ = 0D;
135   /**
136    *
137    *
138    * <pre>
139    * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
140    * increase 20 semitones from the original pitch. -20 means decrease 20
141    * semitones from the original pitch.
142    * </pre>
143    *
144    * <code>
145    * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
146    * </code>
147    *
148    * @return The pitch.
149    */
150   @java.lang.Override
getPitch()151   public double getPitch() {
152     return pitch_;
153   }
154 
155   public static final int VOLUME_GAIN_DB_FIELD_NUMBER = 4;
156   private double volumeGainDb_ = 0D;
157   /**
158    *
159    *
160    * <pre>
161    * Optional. Input only. Volume gain (in dB) of the normal native volume
162    * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
163    * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
164    * value of -6.0 (dB) will play at approximately half the amplitude of the
165    * normal native signal amplitude. A value of +6.0 (dB) will play at
166    * approximately twice the amplitude of the normal native signal amplitude.
167    * Strongly recommend not to exceed +10 (dB) as there's usually no effective
168    * increase in loudness for any value greater than that.
169    * </pre>
170    *
171    * <code>
172    * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
173    * </code>
174    *
175    * @return The volumeGainDb.
176    */
177   @java.lang.Override
getVolumeGainDb()178   public double getVolumeGainDb() {
179     return volumeGainDb_;
180   }
181 
182   public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 5;
183   private int sampleRateHertz_ = 0;
184   /**
185    *
186    *
187    * <pre>
188    * Optional. The synthesis sample rate (in hertz) for this audio. When this is
189    * specified in SynthesizeSpeechRequest, if this is different from the voice's
190    * natural sample rate, then the synthesizer will honor this request by
191    * converting to the desired sample rate (which might result in worse audio
192    * quality), unless the specified sample rate is not supported for the
193    * encoding chosen, in which case it will fail the request and return
194    * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
195    * </pre>
196    *
197    * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
198    *
199    * @return The sampleRateHertz.
200    */
201   @java.lang.Override
getSampleRateHertz()202   public int getSampleRateHertz() {
203     return sampleRateHertz_;
204   }
205 
206   public static final int EFFECTS_PROFILE_ID_FIELD_NUMBER = 6;
207 
208   @SuppressWarnings("serial")
209   private com.google.protobuf.LazyStringList effectsProfileId_;
210   /**
211    *
212    *
213    * <pre>
214    * Optional. Input only. An identifier which selects 'audio effects' profiles
215    * that are applied on (post synthesized) text to speech. Effects are applied
216    * on top of each other in the order they are given. See
217    * [audio
218    * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
219    * current supported profile ids.
220    * </pre>
221    *
222    * <code>
223    * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
224    * </code>
225    *
226    * @return A list containing the effectsProfileId.
227    */
getEffectsProfileIdList()228   public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() {
229     return effectsProfileId_;
230   }
231   /**
232    *
233    *
234    * <pre>
235    * Optional. Input only. An identifier which selects 'audio effects' profiles
236    * that are applied on (post synthesized) text to speech. Effects are applied
237    * on top of each other in the order they are given. See
238    * [audio
239    * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
240    * current supported profile ids.
241    * </pre>
242    *
243    * <code>
244    * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
245    * </code>
246    *
247    * @return The count of effectsProfileId.
248    */
getEffectsProfileIdCount()249   public int getEffectsProfileIdCount() {
250     return effectsProfileId_.size();
251   }
252   /**
253    *
254    *
255    * <pre>
256    * Optional. Input only. An identifier which selects 'audio effects' profiles
257    * that are applied on (post synthesized) text to speech. Effects are applied
258    * on top of each other in the order they are given. See
259    * [audio
260    * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
261    * current supported profile ids.
262    * </pre>
263    *
264    * <code>
265    * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
266    * </code>
267    *
268    * @param index The index of the element to return.
269    * @return The effectsProfileId at the given index.
270    */
getEffectsProfileId(int index)271   public java.lang.String getEffectsProfileId(int index) {
272     return effectsProfileId_.get(index);
273   }
274   /**
275    *
276    *
277    * <pre>
278    * Optional. Input only. An identifier which selects 'audio effects' profiles
279    * that are applied on (post synthesized) text to speech. Effects are applied
280    * on top of each other in the order they are given. See
281    * [audio
282    * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
283    * current supported profile ids.
284    * </pre>
285    *
286    * <code>
287    * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
288    * </code>
289    *
290    * @param index The index of the value to return.
291    * @return The bytes of the effectsProfileId at the given index.
292    */
getEffectsProfileIdBytes(int index)293   public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) {
294     return effectsProfileId_.getByteString(index);
295   }
296 
297   private byte memoizedIsInitialized = -1;
298 
299   @java.lang.Override
isInitialized()300   public final boolean isInitialized() {
301     byte isInitialized = memoizedIsInitialized;
302     if (isInitialized == 1) return true;
303     if (isInitialized == 0) return false;
304 
305     memoizedIsInitialized = 1;
306     return true;
307   }
308 
309   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)310   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
311     if (audioEncoding_
312         != com.google.cloud.texttospeech.v1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED.getNumber()) {
313       output.writeEnum(1, audioEncoding_);
314     }
315     if (java.lang.Double.doubleToRawLongBits(speakingRate_) != 0) {
316       output.writeDouble(2, speakingRate_);
317     }
318     if (java.lang.Double.doubleToRawLongBits(pitch_) != 0) {
319       output.writeDouble(3, pitch_);
320     }
321     if (java.lang.Double.doubleToRawLongBits(volumeGainDb_) != 0) {
322       output.writeDouble(4, volumeGainDb_);
323     }
324     if (sampleRateHertz_ != 0) {
325       output.writeInt32(5, sampleRateHertz_);
326     }
327     for (int i = 0; i < effectsProfileId_.size(); i++) {
328       com.google.protobuf.GeneratedMessageV3.writeString(output, 6, effectsProfileId_.getRaw(i));
329     }
330     getUnknownFields().writeTo(output);
331   }
332 
333   @java.lang.Override
getSerializedSize()334   public int getSerializedSize() {
335     int size = memoizedSize;
336     if (size != -1) return size;
337 
338     size = 0;
339     if (audioEncoding_
340         != com.google.cloud.texttospeech.v1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED.getNumber()) {
341       size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, audioEncoding_);
342     }
343     if (java.lang.Double.doubleToRawLongBits(speakingRate_) != 0) {
344       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, speakingRate_);
345     }
346     if (java.lang.Double.doubleToRawLongBits(pitch_) != 0) {
347       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, pitch_);
348     }
349     if (java.lang.Double.doubleToRawLongBits(volumeGainDb_) != 0) {
350       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, volumeGainDb_);
351     }
352     if (sampleRateHertz_ != 0) {
353       size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, sampleRateHertz_);
354     }
355     {
356       int dataSize = 0;
357       for (int i = 0; i < effectsProfileId_.size(); i++) {
358         dataSize += computeStringSizeNoTag(effectsProfileId_.getRaw(i));
359       }
360       size += dataSize;
361       size += 1 * getEffectsProfileIdList().size();
362     }
363     size += getUnknownFields().getSerializedSize();
364     memoizedSize = size;
365     return size;
366   }
367 
368   @java.lang.Override
equals(final java.lang.Object obj)369   public boolean equals(final java.lang.Object obj) {
370     if (obj == this) {
371       return true;
372     }
373     if (!(obj instanceof com.google.cloud.texttospeech.v1.AudioConfig)) {
374       return super.equals(obj);
375     }
376     com.google.cloud.texttospeech.v1.AudioConfig other =
377         (com.google.cloud.texttospeech.v1.AudioConfig) obj;
378 
379     if (audioEncoding_ != other.audioEncoding_) return false;
380     if (java.lang.Double.doubleToLongBits(getSpeakingRate())
381         != java.lang.Double.doubleToLongBits(other.getSpeakingRate())) return false;
382     if (java.lang.Double.doubleToLongBits(getPitch())
383         != java.lang.Double.doubleToLongBits(other.getPitch())) return false;
384     if (java.lang.Double.doubleToLongBits(getVolumeGainDb())
385         != java.lang.Double.doubleToLongBits(other.getVolumeGainDb())) return false;
386     if (getSampleRateHertz() != other.getSampleRateHertz()) return false;
387     if (!getEffectsProfileIdList().equals(other.getEffectsProfileIdList())) return false;
388     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
389     return true;
390   }
391 
392   @java.lang.Override
hashCode()393   public int hashCode() {
394     if (memoizedHashCode != 0) {
395       return memoizedHashCode;
396     }
397     int hash = 41;
398     hash = (19 * hash) + getDescriptor().hashCode();
399     hash = (37 * hash) + AUDIO_ENCODING_FIELD_NUMBER;
400     hash = (53 * hash) + audioEncoding_;
401     hash = (37 * hash) + SPEAKING_RATE_FIELD_NUMBER;
402     hash =
403         (53 * hash)
404             + com.google.protobuf.Internal.hashLong(
405                 java.lang.Double.doubleToLongBits(getSpeakingRate()));
406     hash = (37 * hash) + PITCH_FIELD_NUMBER;
407     hash =
408         (53 * hash)
409             + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getPitch()));
410     hash = (37 * hash) + VOLUME_GAIN_DB_FIELD_NUMBER;
411     hash =
412         (53 * hash)
413             + com.google.protobuf.Internal.hashLong(
414                 java.lang.Double.doubleToLongBits(getVolumeGainDb()));
415     hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER;
416     hash = (53 * hash) + getSampleRateHertz();
417     if (getEffectsProfileIdCount() > 0) {
418       hash = (37 * hash) + EFFECTS_PROFILE_ID_FIELD_NUMBER;
419       hash = (53 * hash) + getEffectsProfileIdList().hashCode();
420     }
421     hash = (29 * hash) + getUnknownFields().hashCode();
422     memoizedHashCode = hash;
423     return hash;
424   }
425 
parseFrom(java.nio.ByteBuffer data)426   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(java.nio.ByteBuffer data)
427       throws com.google.protobuf.InvalidProtocolBufferException {
428     return PARSER.parseFrom(data);
429   }
430 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)431   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
432       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
433       throws com.google.protobuf.InvalidProtocolBufferException {
434     return PARSER.parseFrom(data, extensionRegistry);
435   }
436 
parseFrom( com.google.protobuf.ByteString data)437   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
438       com.google.protobuf.ByteString data)
439       throws com.google.protobuf.InvalidProtocolBufferException {
440     return PARSER.parseFrom(data);
441   }
442 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)443   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
444       com.google.protobuf.ByteString data,
445       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
446       throws com.google.protobuf.InvalidProtocolBufferException {
447     return PARSER.parseFrom(data, extensionRegistry);
448   }
449 
parseFrom(byte[] data)450   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(byte[] data)
451       throws com.google.protobuf.InvalidProtocolBufferException {
452     return PARSER.parseFrom(data);
453   }
454 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)455   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
456       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
457       throws com.google.protobuf.InvalidProtocolBufferException {
458     return PARSER.parseFrom(data, extensionRegistry);
459   }
460 
parseFrom(java.io.InputStream input)461   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(java.io.InputStream input)
462       throws java.io.IOException {
463     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
464   }
465 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)466   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
467       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
468       throws java.io.IOException {
469     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
470         PARSER, input, extensionRegistry);
471   }
472 
parseDelimitedFrom( java.io.InputStream input)473   public static com.google.cloud.texttospeech.v1.AudioConfig parseDelimitedFrom(
474       java.io.InputStream input) throws java.io.IOException {
475     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
476   }
477 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)478   public static com.google.cloud.texttospeech.v1.AudioConfig parseDelimitedFrom(
479       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
480       throws java.io.IOException {
481     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
482         PARSER, input, extensionRegistry);
483   }
484 
parseFrom( com.google.protobuf.CodedInputStream input)485   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
486       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
487     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
488   }
489 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)490   public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
491       com.google.protobuf.CodedInputStream input,
492       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
493       throws java.io.IOException {
494     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
495         PARSER, input, extensionRegistry);
496   }
497 
498   @java.lang.Override
newBuilderForType()499   public Builder newBuilderForType() {
500     return newBuilder();
501   }
502 
newBuilder()503   public static Builder newBuilder() {
504     return DEFAULT_INSTANCE.toBuilder();
505   }
506 
newBuilder(com.google.cloud.texttospeech.v1.AudioConfig prototype)507   public static Builder newBuilder(com.google.cloud.texttospeech.v1.AudioConfig prototype) {
508     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
509   }
510 
511   @java.lang.Override
toBuilder()512   public Builder toBuilder() {
513     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
514   }
515 
516   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)517   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
518     Builder builder = new Builder(parent);
519     return builder;
520   }
521   /**
522    *
523    *
524    * <pre>
525    * Description of audio data to be synthesized.
526    * </pre>
527    *
528    * Protobuf type {@code google.cloud.texttospeech.v1.AudioConfig}
529    */
530   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
531       implements
532       // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.AudioConfig)
533       com.google.cloud.texttospeech.v1.AudioConfigOrBuilder {
getDescriptor()534     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
535       return com.google.cloud.texttospeech.v1.TextToSpeechProto
536           .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
537     }
538 
539     @java.lang.Override
540     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()541         internalGetFieldAccessorTable() {
542       return com.google.cloud.texttospeech.v1.TextToSpeechProto
543           .internal_static_google_cloud_texttospeech_v1_AudioConfig_fieldAccessorTable
544           .ensureFieldAccessorsInitialized(
545               com.google.cloud.texttospeech.v1.AudioConfig.class,
546               com.google.cloud.texttospeech.v1.AudioConfig.Builder.class);
547     }
548 
549     // Construct using com.google.cloud.texttospeech.v1.AudioConfig.newBuilder()
Builder()550     private Builder() {}
551 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)552     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
553       super(parent);
554     }
555 
556     @java.lang.Override
clear()557     public Builder clear() {
558       super.clear();
559       bitField0_ = 0;
560       audioEncoding_ = 0;
561       speakingRate_ = 0D;
562       pitch_ = 0D;
563       volumeGainDb_ = 0D;
564       sampleRateHertz_ = 0;
565       effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
566       bitField0_ = (bitField0_ & ~0x00000020);
567       return this;
568     }
569 
570     @java.lang.Override
getDescriptorForType()571     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
572       return com.google.cloud.texttospeech.v1.TextToSpeechProto
573           .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
574     }
575 
576     @java.lang.Override
getDefaultInstanceForType()577     public com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstanceForType() {
578       return com.google.cloud.texttospeech.v1.AudioConfig.getDefaultInstance();
579     }
580 
581     @java.lang.Override
build()582     public com.google.cloud.texttospeech.v1.AudioConfig build() {
583       com.google.cloud.texttospeech.v1.AudioConfig result = buildPartial();
584       if (!result.isInitialized()) {
585         throw newUninitializedMessageException(result);
586       }
587       return result;
588     }
589 
590     @java.lang.Override
buildPartial()591     public com.google.cloud.texttospeech.v1.AudioConfig buildPartial() {
592       com.google.cloud.texttospeech.v1.AudioConfig result =
593           new com.google.cloud.texttospeech.v1.AudioConfig(this);
594       buildPartialRepeatedFields(result);
595       if (bitField0_ != 0) {
596         buildPartial0(result);
597       }
598       onBuilt();
599       return result;
600     }
601 
buildPartialRepeatedFields(com.google.cloud.texttospeech.v1.AudioConfig result)602     private void buildPartialRepeatedFields(com.google.cloud.texttospeech.v1.AudioConfig result) {
603       if (((bitField0_ & 0x00000020) != 0)) {
604         effectsProfileId_ = effectsProfileId_.getUnmodifiableView();
605         bitField0_ = (bitField0_ & ~0x00000020);
606       }
607       result.effectsProfileId_ = effectsProfileId_;
608     }
609 
buildPartial0(com.google.cloud.texttospeech.v1.AudioConfig result)610     private void buildPartial0(com.google.cloud.texttospeech.v1.AudioConfig result) {
611       int from_bitField0_ = bitField0_;
612       if (((from_bitField0_ & 0x00000001) != 0)) {
613         result.audioEncoding_ = audioEncoding_;
614       }
615       if (((from_bitField0_ & 0x00000002) != 0)) {
616         result.speakingRate_ = speakingRate_;
617       }
618       if (((from_bitField0_ & 0x00000004) != 0)) {
619         result.pitch_ = pitch_;
620       }
621       if (((from_bitField0_ & 0x00000008) != 0)) {
622         result.volumeGainDb_ = volumeGainDb_;
623       }
624       if (((from_bitField0_ & 0x00000010) != 0)) {
625         result.sampleRateHertz_ = sampleRateHertz_;
626       }
627     }
628 
629     @java.lang.Override
clone()630     public Builder clone() {
631       return super.clone();
632     }
633 
634     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)635     public Builder setField(
636         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
637       return super.setField(field, value);
638     }
639 
640     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)641     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
642       return super.clearField(field);
643     }
644 
645     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)646     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
647       return super.clearOneof(oneof);
648     }
649 
650     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)651     public Builder setRepeatedField(
652         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
653       return super.setRepeatedField(field, index, value);
654     }
655 
656     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)657     public Builder addRepeatedField(
658         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
659       return super.addRepeatedField(field, value);
660     }
661 
662     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)663     public Builder mergeFrom(com.google.protobuf.Message other) {
664       if (other instanceof com.google.cloud.texttospeech.v1.AudioConfig) {
665         return mergeFrom((com.google.cloud.texttospeech.v1.AudioConfig) other);
666       } else {
667         super.mergeFrom(other);
668         return this;
669       }
670     }
671 
mergeFrom(com.google.cloud.texttospeech.v1.AudioConfig other)672     public Builder mergeFrom(com.google.cloud.texttospeech.v1.AudioConfig other) {
673       if (other == com.google.cloud.texttospeech.v1.AudioConfig.getDefaultInstance()) return this;
674       if (other.audioEncoding_ != 0) {
675         setAudioEncodingValue(other.getAudioEncodingValue());
676       }
677       if (other.getSpeakingRate() != 0D) {
678         setSpeakingRate(other.getSpeakingRate());
679       }
680       if (other.getPitch() != 0D) {
681         setPitch(other.getPitch());
682       }
683       if (other.getVolumeGainDb() != 0D) {
684         setVolumeGainDb(other.getVolumeGainDb());
685       }
686       if (other.getSampleRateHertz() != 0) {
687         setSampleRateHertz(other.getSampleRateHertz());
688       }
689       if (!other.effectsProfileId_.isEmpty()) {
690         if (effectsProfileId_.isEmpty()) {
691           effectsProfileId_ = other.effectsProfileId_;
692           bitField0_ = (bitField0_ & ~0x00000020);
693         } else {
694           ensureEffectsProfileIdIsMutable();
695           effectsProfileId_.addAll(other.effectsProfileId_);
696         }
697         onChanged();
698       }
699       this.mergeUnknownFields(other.getUnknownFields());
700       onChanged();
701       return this;
702     }
703 
704     @java.lang.Override
isInitialized()705     public final boolean isInitialized() {
706       return true;
707     }
708 
709     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)710     public Builder mergeFrom(
711         com.google.protobuf.CodedInputStream input,
712         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
713         throws java.io.IOException {
714       if (extensionRegistry == null) {
715         throw new java.lang.NullPointerException();
716       }
717       try {
718         boolean done = false;
719         while (!done) {
720           int tag = input.readTag();
721           switch (tag) {
722             case 0:
723               done = true;
724               break;
725             case 8:
726               {
727                 audioEncoding_ = input.readEnum();
728                 bitField0_ |= 0x00000001;
729                 break;
730               } // case 8
731             case 17:
732               {
733                 speakingRate_ = input.readDouble();
734                 bitField0_ |= 0x00000002;
735                 break;
736               } // case 17
737             case 25:
738               {
739                 pitch_ = input.readDouble();
740                 bitField0_ |= 0x00000004;
741                 break;
742               } // case 25
743             case 33:
744               {
745                 volumeGainDb_ = input.readDouble();
746                 bitField0_ |= 0x00000008;
747                 break;
748               } // case 33
749             case 40:
750               {
751                 sampleRateHertz_ = input.readInt32();
752                 bitField0_ |= 0x00000010;
753                 break;
754               } // case 40
755             case 50:
756               {
757                 java.lang.String s = input.readStringRequireUtf8();
758                 ensureEffectsProfileIdIsMutable();
759                 effectsProfileId_.add(s);
760                 break;
761               } // case 50
762             default:
763               {
764                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
765                   done = true; // was an endgroup tag
766                 }
767                 break;
768               } // default:
769           } // switch (tag)
770         } // while (!done)
771       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
772         throw e.unwrapIOException();
773       } finally {
774         onChanged();
775       } // finally
776       return this;
777     }
778 
779     private int bitField0_;
780 
781     private int audioEncoding_ = 0;
782     /**
783      *
784      *
785      * <pre>
786      * Required. The format of the audio byte stream.
787      * </pre>
788      *
789      * <code>
790      * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
791      * </code>
792      *
793      * @return The enum numeric value on the wire for audioEncoding.
794      */
795     @java.lang.Override
getAudioEncodingValue()796     public int getAudioEncodingValue() {
797       return audioEncoding_;
798     }
799     /**
800      *
801      *
802      * <pre>
803      * Required. The format of the audio byte stream.
804      * </pre>
805      *
806      * <code>
807      * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
808      * </code>
809      *
810      * @param value The enum numeric value on the wire for audioEncoding to set.
811      * @return This builder for chaining.
812      */
setAudioEncodingValue(int value)813     public Builder setAudioEncodingValue(int value) {
814       audioEncoding_ = value;
815       bitField0_ |= 0x00000001;
816       onChanged();
817       return this;
818     }
819     /**
820      *
821      *
822      * <pre>
823      * Required. The format of the audio byte stream.
824      * </pre>
825      *
826      * <code>
827      * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
828      * </code>
829      *
830      * @return The audioEncoding.
831      */
832     @java.lang.Override
getAudioEncoding()833     public com.google.cloud.texttospeech.v1.AudioEncoding getAudioEncoding() {
834       com.google.cloud.texttospeech.v1.AudioEncoding result =
835           com.google.cloud.texttospeech.v1.AudioEncoding.forNumber(audioEncoding_);
836       return result == null ? com.google.cloud.texttospeech.v1.AudioEncoding.UNRECOGNIZED : result;
837     }
838     /**
839      *
840      *
841      * <pre>
842      * Required. The format of the audio byte stream.
843      * </pre>
844      *
845      * <code>
846      * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
847      * </code>
848      *
849      * @param value The audioEncoding to set.
850      * @return This builder for chaining.
851      */
setAudioEncoding(com.google.cloud.texttospeech.v1.AudioEncoding value)852     public Builder setAudioEncoding(com.google.cloud.texttospeech.v1.AudioEncoding value) {
853       if (value == null) {
854         throw new NullPointerException();
855       }
856       bitField0_ |= 0x00000001;
857       audioEncoding_ = value.getNumber();
858       onChanged();
859       return this;
860     }
861     /**
862      *
863      *
864      * <pre>
865      * Required. The format of the audio byte stream.
866      * </pre>
867      *
868      * <code>
869      * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
870      * </code>
871      *
872      * @return This builder for chaining.
873      */
clearAudioEncoding()874     public Builder clearAudioEncoding() {
875       bitField0_ = (bitField0_ & ~0x00000001);
876       audioEncoding_ = 0;
877       onChanged();
878       return this;
879     }
880 
881     private double speakingRate_;
882     /**
883      *
884      *
885      * <pre>
886      * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
887      * the normal native speed supported by the specific voice. 2.0 is twice as
888      * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
889      * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
890      * </pre>
891      *
892      * <code>
893      * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
894      * </code>
895      *
896      * @return The speakingRate.
897      */
898     @java.lang.Override
getSpeakingRate()899     public double getSpeakingRate() {
900       return speakingRate_;
901     }
902     /**
903      *
904      *
905      * <pre>
906      * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
907      * the normal native speed supported by the specific voice. 2.0 is twice as
908      * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
909      * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
910      * </pre>
911      *
912      * <code>
913      * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
914      * </code>
915      *
916      * @param value The speakingRate to set.
917      * @return This builder for chaining.
918      */
setSpeakingRate(double value)919     public Builder setSpeakingRate(double value) {
920 
921       speakingRate_ = value;
922       bitField0_ |= 0x00000002;
923       onChanged();
924       return this;
925     }
926     /**
927      *
928      *
929      * <pre>
930      * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
931      * the normal native speed supported by the specific voice. 2.0 is twice as
932      * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
933      * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
934      * </pre>
935      *
936      * <code>
937      * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
938      * </code>
939      *
940      * @return This builder for chaining.
941      */
clearSpeakingRate()942     public Builder clearSpeakingRate() {
943       bitField0_ = (bitField0_ & ~0x00000002);
944       speakingRate_ = 0D;
945       onChanged();
946       return this;
947     }
948 
949     private double pitch_;
950     /**
951      *
952      *
953      * <pre>
954      * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
955      * increase 20 semitones from the original pitch. -20 means decrease 20
956      * semitones from the original pitch.
957      * </pre>
958      *
959      * <code>
960      * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
961      * </code>
962      *
963      * @return The pitch.
964      */
965     @java.lang.Override
getPitch()966     public double getPitch() {
967       return pitch_;
968     }
969     /**
970      *
971      *
972      * <pre>
973      * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
974      * increase 20 semitones from the original pitch. -20 means decrease 20
975      * semitones from the original pitch.
976      * </pre>
977      *
978      * <code>
979      * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
980      * </code>
981      *
982      * @param value The pitch to set.
983      * @return This builder for chaining.
984      */
setPitch(double value)985     public Builder setPitch(double value) {
986 
987       pitch_ = value;
988       bitField0_ |= 0x00000004;
989       onChanged();
990       return this;
991     }
992     /**
993      *
994      *
995      * <pre>
996      * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
997      * increase 20 semitones from the original pitch. -20 means decrease 20
998      * semitones from the original pitch.
999      * </pre>
1000      *
1001      * <code>
1002      * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1003      * </code>
1004      *
1005      * @return This builder for chaining.
1006      */
clearPitch()1007     public Builder clearPitch() {
1008       bitField0_ = (bitField0_ & ~0x00000004);
1009       pitch_ = 0D;
1010       onChanged();
1011       return this;
1012     }
1013 
1014     private double volumeGainDb_;
1015     /**
1016      *
1017      *
1018      * <pre>
1019      * Optional. Input only. Volume gain (in dB) of the normal native volume
1020      * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
1021      * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
1022      * value of -6.0 (dB) will play at approximately half the amplitude of the
1023      * normal native signal amplitude. A value of +6.0 (dB) will play at
1024      * approximately twice the amplitude of the normal native signal amplitude.
1025      * Strongly recommend not to exceed +10 (dB) as there's usually no effective
1026      * increase in loudness for any value greater than that.
1027      * </pre>
1028      *
1029      * <code>
1030      * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1031      * </code>
1032      *
1033      * @return The volumeGainDb.
1034      */
1035     @java.lang.Override
getVolumeGainDb()1036     public double getVolumeGainDb() {
1037       return volumeGainDb_;
1038     }
1039     /**
1040      *
1041      *
1042      * <pre>
1043      * Optional. Input only. Volume gain (in dB) of the normal native volume
1044      * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
1045      * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
1046      * value of -6.0 (dB) will play at approximately half the amplitude of the
1047      * normal native signal amplitude. A value of +6.0 (dB) will play at
1048      * approximately twice the amplitude of the normal native signal amplitude.
1049      * Strongly recommend not to exceed +10 (dB) as there's usually no effective
1050      * increase in loudness for any value greater than that.
1051      * </pre>
1052      *
1053      * <code>
1054      * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1055      * </code>
1056      *
1057      * @param value The volumeGainDb to set.
1058      * @return This builder for chaining.
1059      */
setVolumeGainDb(double value)1060     public Builder setVolumeGainDb(double value) {
1061 
1062       volumeGainDb_ = value;
1063       bitField0_ |= 0x00000008;
1064       onChanged();
1065       return this;
1066     }
1067     /**
1068      *
1069      *
1070      * <pre>
1071      * Optional. Input only. Volume gain (in dB) of the normal native volume
1072      * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
1073      * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
1074      * value of -6.0 (dB) will play at approximately half the amplitude of the
1075      * normal native signal amplitude. A value of +6.0 (dB) will play at
1076      * approximately twice the amplitude of the normal native signal amplitude.
1077      * Strongly recommend not to exceed +10 (dB) as there's usually no effective
1078      * increase in loudness for any value greater than that.
1079      * </pre>
1080      *
1081      * <code>
1082      * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1083      * </code>
1084      *
1085      * @return This builder for chaining.
1086      */
clearVolumeGainDb()1087     public Builder clearVolumeGainDb() {
1088       bitField0_ = (bitField0_ & ~0x00000008);
1089       volumeGainDb_ = 0D;
1090       onChanged();
1091       return this;
1092     }
1093 
1094     private int sampleRateHertz_;
1095     /**
1096      *
1097      *
1098      * <pre>
1099      * Optional. The synthesis sample rate (in hertz) for this audio. When this is
1100      * specified in SynthesizeSpeechRequest, if this is different from the voice's
1101      * natural sample rate, then the synthesizer will honor this request by
1102      * converting to the desired sample rate (which might result in worse audio
1103      * quality), unless the specified sample rate is not supported for the
1104      * encoding chosen, in which case it will fail the request and return
1105      * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
1106      * </pre>
1107      *
1108      * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
1109      *
1110      * @return The sampleRateHertz.
1111      */
1112     @java.lang.Override
getSampleRateHertz()1113     public int getSampleRateHertz() {
1114       return sampleRateHertz_;
1115     }
1116     /**
1117      *
1118      *
1119      * <pre>
1120      * Optional. The synthesis sample rate (in hertz) for this audio. When this is
1121      * specified in SynthesizeSpeechRequest, if this is different from the voice's
1122      * natural sample rate, then the synthesizer will honor this request by
1123      * converting to the desired sample rate (which might result in worse audio
1124      * quality), unless the specified sample rate is not supported for the
1125      * encoding chosen, in which case it will fail the request and return
1126      * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
1127      * </pre>
1128      *
1129      * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
1130      *
1131      * @param value The sampleRateHertz to set.
1132      * @return This builder for chaining.
1133      */
setSampleRateHertz(int value)1134     public Builder setSampleRateHertz(int value) {
1135 
1136       sampleRateHertz_ = value;
1137       bitField0_ |= 0x00000010;
1138       onChanged();
1139       return this;
1140     }
1141     /**
1142      *
1143      *
1144      * <pre>
1145      * Optional. The synthesis sample rate (in hertz) for this audio. When this is
1146      * specified in SynthesizeSpeechRequest, if this is different from the voice's
1147      * natural sample rate, then the synthesizer will honor this request by
1148      * converting to the desired sample rate (which might result in worse audio
1149      * quality), unless the specified sample rate is not supported for the
1150      * encoding chosen, in which case it will fail the request and return
1151      * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
1152      * </pre>
1153      *
1154      * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
1155      *
1156      * @return This builder for chaining.
1157      */
clearSampleRateHertz()1158     public Builder clearSampleRateHertz() {
1159       bitField0_ = (bitField0_ & ~0x00000010);
1160       sampleRateHertz_ = 0;
1161       onChanged();
1162       return this;
1163     }
1164 
1165     private com.google.protobuf.LazyStringList effectsProfileId_ =
1166         com.google.protobuf.LazyStringArrayList.EMPTY;
1167 
ensureEffectsProfileIdIsMutable()1168     private void ensureEffectsProfileIdIsMutable() {
1169       if (!((bitField0_ & 0x00000020) != 0)) {
1170         effectsProfileId_ = new com.google.protobuf.LazyStringArrayList(effectsProfileId_);
1171         bitField0_ |= 0x00000020;
1172       }
1173     }
1174     /**
1175      *
1176      *
1177      * <pre>
1178      * Optional. Input only. An identifier which selects 'audio effects' profiles
1179      * that are applied on (post synthesized) text to speech. Effects are applied
1180      * on top of each other in the order they are given. See
1181      * [audio
1182      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1183      * current supported profile ids.
1184      * </pre>
1185      *
1186      * <code>
1187      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1188      * </code>
1189      *
1190      * @return A list containing the effectsProfileId.
1191      */
getEffectsProfileIdList()1192     public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() {
1193       return effectsProfileId_.getUnmodifiableView();
1194     }
1195     /**
1196      *
1197      *
1198      * <pre>
1199      * Optional. Input only. An identifier which selects 'audio effects' profiles
1200      * that are applied on (post synthesized) text to speech. Effects are applied
1201      * on top of each other in the order they are given. See
1202      * [audio
1203      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1204      * current supported profile ids.
1205      * </pre>
1206      *
1207      * <code>
1208      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1209      * </code>
1210      *
1211      * @return The count of effectsProfileId.
1212      */
getEffectsProfileIdCount()1213     public int getEffectsProfileIdCount() {
1214       return effectsProfileId_.size();
1215     }
1216     /**
1217      *
1218      *
1219      * <pre>
1220      * Optional. Input only. An identifier which selects 'audio effects' profiles
1221      * that are applied on (post synthesized) text to speech. Effects are applied
1222      * on top of each other in the order they are given. See
1223      * [audio
1224      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1225      * current supported profile ids.
1226      * </pre>
1227      *
1228      * <code>
1229      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1230      * </code>
1231      *
1232      * @param index The index of the element to return.
1233      * @return The effectsProfileId at the given index.
1234      */
getEffectsProfileId(int index)1235     public java.lang.String getEffectsProfileId(int index) {
1236       return effectsProfileId_.get(index);
1237     }
1238     /**
1239      *
1240      *
1241      * <pre>
1242      * Optional. Input only. An identifier which selects 'audio effects' profiles
1243      * that are applied on (post synthesized) text to speech. Effects are applied
1244      * on top of each other in the order they are given. See
1245      * [audio
1246      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1247      * current supported profile ids.
1248      * </pre>
1249      *
1250      * <code>
1251      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1252      * </code>
1253      *
1254      * @param index The index of the value to return.
1255      * @return The bytes of the effectsProfileId at the given index.
1256      */
getEffectsProfileIdBytes(int index)1257     public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) {
1258       return effectsProfileId_.getByteString(index);
1259     }
1260     /**
1261      *
1262      *
1263      * <pre>
1264      * Optional. Input only. An identifier which selects 'audio effects' profiles
1265      * that are applied on (post synthesized) text to speech. Effects are applied
1266      * on top of each other in the order they are given. See
1267      * [audio
1268      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1269      * current supported profile ids.
1270      * </pre>
1271      *
1272      * <code>
1273      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1274      * </code>
1275      *
1276      * @param index The index to set the value at.
1277      * @param value The effectsProfileId to set.
1278      * @return This builder for chaining.
1279      */
setEffectsProfileId(int index, java.lang.String value)1280     public Builder setEffectsProfileId(int index, java.lang.String value) {
1281       if (value == null) {
1282         throw new NullPointerException();
1283       }
1284       ensureEffectsProfileIdIsMutable();
1285       effectsProfileId_.set(index, value);
1286       onChanged();
1287       return this;
1288     }
1289     /**
1290      *
1291      *
1292      * <pre>
1293      * Optional. Input only. An identifier which selects 'audio effects' profiles
1294      * that are applied on (post synthesized) text to speech. Effects are applied
1295      * on top of each other in the order they are given. See
1296      * [audio
1297      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1298      * current supported profile ids.
1299      * </pre>
1300      *
1301      * <code>
1302      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1303      * </code>
1304      *
1305      * @param value The effectsProfileId to add.
1306      * @return This builder for chaining.
1307      */
addEffectsProfileId(java.lang.String value)1308     public Builder addEffectsProfileId(java.lang.String value) {
1309       if (value == null) {
1310         throw new NullPointerException();
1311       }
1312       ensureEffectsProfileIdIsMutable();
1313       effectsProfileId_.add(value);
1314       onChanged();
1315       return this;
1316     }
1317     /**
1318      *
1319      *
1320      * <pre>
1321      * Optional. Input only. An identifier which selects 'audio effects' profiles
1322      * that are applied on (post synthesized) text to speech. Effects are applied
1323      * on top of each other in the order they are given. See
1324      * [audio
1325      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1326      * current supported profile ids.
1327      * </pre>
1328      *
1329      * <code>
1330      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1331      * </code>
1332      *
1333      * @param values The effectsProfileId to add.
1334      * @return This builder for chaining.
1335      */
addAllEffectsProfileId(java.lang.Iterable<java.lang.String> values)1336     public Builder addAllEffectsProfileId(java.lang.Iterable<java.lang.String> values) {
1337       ensureEffectsProfileIdIsMutable();
1338       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, effectsProfileId_);
1339       onChanged();
1340       return this;
1341     }
1342     /**
1343      *
1344      *
1345      * <pre>
1346      * Optional. Input only. An identifier which selects 'audio effects' profiles
1347      * that are applied on (post synthesized) text to speech. Effects are applied
1348      * on top of each other in the order they are given. See
1349      * [audio
1350      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1351      * current supported profile ids.
1352      * </pre>
1353      *
1354      * <code>
1355      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1356      * </code>
1357      *
1358      * @return This builder for chaining.
1359      */
clearEffectsProfileId()1360     public Builder clearEffectsProfileId() {
1361       effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1362       bitField0_ = (bitField0_ & ~0x00000020);
1363       onChanged();
1364       return this;
1365     }
1366     /**
1367      *
1368      *
1369      * <pre>
1370      * Optional. Input only. An identifier which selects 'audio effects' profiles
1371      * that are applied on (post synthesized) text to speech. Effects are applied
1372      * on top of each other in the order they are given. See
1373      * [audio
1374      * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
1375      * current supported profile ids.
1376      * </pre>
1377      *
1378      * <code>
1379      * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
1380      * </code>
1381      *
1382      * @param value The bytes of the effectsProfileId to add.
1383      * @return This builder for chaining.
1384      */
addEffectsProfileIdBytes(com.google.protobuf.ByteString value)1385     public Builder addEffectsProfileIdBytes(com.google.protobuf.ByteString value) {
1386       if (value == null) {
1387         throw new NullPointerException();
1388       }
1389       checkByteStringIsUtf8(value);
1390       ensureEffectsProfileIdIsMutable();
1391       effectsProfileId_.add(value);
1392       onChanged();
1393       return this;
1394     }
1395 
1396     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1397     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1398       return super.setUnknownFields(unknownFields);
1399     }
1400 
1401     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1402     public final Builder mergeUnknownFields(
1403         final com.google.protobuf.UnknownFieldSet unknownFields) {
1404       return super.mergeUnknownFields(unknownFields);
1405     }
1406 
1407     // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.AudioConfig)
1408   }
1409 
1410   // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.AudioConfig)
1411   private static final com.google.cloud.texttospeech.v1.AudioConfig DEFAULT_INSTANCE;
1412 
1413   static {
1414     DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.AudioConfig();
1415   }
1416 
getDefaultInstance()1417   public static com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstance() {
1418     return DEFAULT_INSTANCE;
1419   }
1420 
1421   private static final com.google.protobuf.Parser<AudioConfig> PARSER =
1422       new com.google.protobuf.AbstractParser<AudioConfig>() {
1423         @java.lang.Override
1424         public AudioConfig parsePartialFrom(
1425             com.google.protobuf.CodedInputStream input,
1426             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1427             throws com.google.protobuf.InvalidProtocolBufferException {
1428           Builder builder = newBuilder();
1429           try {
1430             builder.mergeFrom(input, extensionRegistry);
1431           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1432             throw e.setUnfinishedMessage(builder.buildPartial());
1433           } catch (com.google.protobuf.UninitializedMessageException e) {
1434             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1435           } catch (java.io.IOException e) {
1436             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1437                 .setUnfinishedMessage(builder.buildPartial());
1438           }
1439           return builder.buildPartial();
1440         }
1441       };
1442 
parser()1443   public static com.google.protobuf.Parser<AudioConfig> parser() {
1444     return PARSER;
1445   }
1446 
1447   @java.lang.Override
getParserForType()1448   public com.google.protobuf.Parser<AudioConfig> getParserForType() {
1449     return PARSER;
1450   }
1451 
1452   @java.lang.Override
getDefaultInstanceForType()1453   public com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstanceForType() {
1454     return DEFAULT_INSTANCE;
1455   }
1456 }
1457