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/speech/v1/cloud_speech.proto 18 19 package com.google.cloud.speech.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Config to enable speaker diarization. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} 29 */ 30 public final class SpeakerDiarizationConfig extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) 33 SpeakerDiarizationConfigOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use SpeakerDiarizationConfig.newBuilder() to construct. SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 SpeakerDiarizationConfig()40 private SpeakerDiarizationConfig() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new SpeakerDiarizationConfig(); 46 } 47 48 @java.lang.Override getUnknownFields()49 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 50 return this.unknownFields; 51 } 52 getDescriptor()53 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 54 return com.google.cloud.speech.v1.SpeechProto 55 .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; 56 } 57 58 @java.lang.Override 59 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()60 internalGetFieldAccessorTable() { 61 return com.google.cloud.speech.v1.SpeechProto 62 .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, 65 com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); 66 } 67 68 public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; 69 private boolean enableSpeakerDiarization_ = false; 70 /** 71 * 72 * 73 * <pre> 74 * If 'true', enables speaker detection for each recognized word in 75 * the top alternative of the recognition result using a speaker_tag provided 76 * in the WordInfo. 77 * </pre> 78 * 79 * <code>bool enable_speaker_diarization = 1;</code> 80 * 81 * @return The enableSpeakerDiarization. 82 */ 83 @java.lang.Override getEnableSpeakerDiarization()84 public boolean getEnableSpeakerDiarization() { 85 return enableSpeakerDiarization_; 86 } 87 88 public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; 89 private int minSpeakerCount_ = 0; 90 /** 91 * 92 * 93 * <pre> 94 * Minimum number of speakers in the conversation. This range gives you more 95 * flexibility by allowing the system to automatically determine the correct 96 * number of speakers. If not set, the default value is 2. 97 * </pre> 98 * 99 * <code>int32 min_speaker_count = 2;</code> 100 * 101 * @return The minSpeakerCount. 102 */ 103 @java.lang.Override getMinSpeakerCount()104 public int getMinSpeakerCount() { 105 return minSpeakerCount_; 106 } 107 108 public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; 109 private int maxSpeakerCount_ = 0; 110 /** 111 * 112 * 113 * <pre> 114 * Maximum number of speakers in the conversation. This range gives you more 115 * flexibility by allowing the system to automatically determine the correct 116 * number of speakers. If not set, the default value is 6. 117 * </pre> 118 * 119 * <code>int32 max_speaker_count = 3;</code> 120 * 121 * @return The maxSpeakerCount. 122 */ 123 @java.lang.Override getMaxSpeakerCount()124 public int getMaxSpeakerCount() { 125 return maxSpeakerCount_; 126 } 127 128 public static final int SPEAKER_TAG_FIELD_NUMBER = 5; 129 private int speakerTag_ = 0; 130 /** 131 * 132 * 133 * <pre> 134 * Output only. Unused. 135 * </pre> 136 * 137 * <code>int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; 138 * </code> 139 * 140 * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See 141 * google/cloud/speech/v1/cloud_speech.proto;l=480 142 * @return The speakerTag. 143 */ 144 @java.lang.Override 145 @java.lang.Deprecated getSpeakerTag()146 public int getSpeakerTag() { 147 return speakerTag_; 148 } 149 150 private byte memoizedIsInitialized = -1; 151 152 @java.lang.Override isInitialized()153 public final boolean isInitialized() { 154 byte isInitialized = memoizedIsInitialized; 155 if (isInitialized == 1) return true; 156 if (isInitialized == 0) return false; 157 158 memoizedIsInitialized = 1; 159 return true; 160 } 161 162 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)163 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 164 if (enableSpeakerDiarization_ != false) { 165 output.writeBool(1, enableSpeakerDiarization_); 166 } 167 if (minSpeakerCount_ != 0) { 168 output.writeInt32(2, minSpeakerCount_); 169 } 170 if (maxSpeakerCount_ != 0) { 171 output.writeInt32(3, maxSpeakerCount_); 172 } 173 if (speakerTag_ != 0) { 174 output.writeInt32(5, speakerTag_); 175 } 176 getUnknownFields().writeTo(output); 177 } 178 179 @java.lang.Override getSerializedSize()180 public int getSerializedSize() { 181 int size = memoizedSize; 182 if (size != -1) return size; 183 184 size = 0; 185 if (enableSpeakerDiarization_ != false) { 186 size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableSpeakerDiarization_); 187 } 188 if (minSpeakerCount_ != 0) { 189 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minSpeakerCount_); 190 } 191 if (maxSpeakerCount_ != 0) { 192 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSpeakerCount_); 193 } 194 if (speakerTag_ != 0) { 195 size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); 196 } 197 size += getUnknownFields().getSerializedSize(); 198 memoizedSize = size; 199 return size; 200 } 201 202 @java.lang.Override equals(final java.lang.Object obj)203 public boolean equals(final java.lang.Object obj) { 204 if (obj == this) { 205 return true; 206 } 207 if (!(obj instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig)) { 208 return super.equals(obj); 209 } 210 com.google.cloud.speech.v1.SpeakerDiarizationConfig other = 211 (com.google.cloud.speech.v1.SpeakerDiarizationConfig) obj; 212 213 if (getEnableSpeakerDiarization() != other.getEnableSpeakerDiarization()) return false; 214 if (getMinSpeakerCount() != other.getMinSpeakerCount()) return false; 215 if (getMaxSpeakerCount() != other.getMaxSpeakerCount()) return false; 216 if (getSpeakerTag() != other.getSpeakerTag()) return false; 217 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 218 return true; 219 } 220 221 @java.lang.Override hashCode()222 public int hashCode() { 223 if (memoizedHashCode != 0) { 224 return memoizedHashCode; 225 } 226 int hash = 41; 227 hash = (19 * hash) + getDescriptor().hashCode(); 228 hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; 229 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpeakerDiarization()); 230 hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; 231 hash = (53 * hash) + getMinSpeakerCount(); 232 hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; 233 hash = (53 * hash) + getMaxSpeakerCount(); 234 hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; 235 hash = (53 * hash) + getSpeakerTag(); 236 hash = (29 * hash) + getUnknownFields().hashCode(); 237 memoizedHashCode = hash; 238 return hash; 239 } 240 parseFrom( java.nio.ByteBuffer data)241 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 242 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 243 return PARSER.parseFrom(data); 244 } 245 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)246 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 247 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 248 throws com.google.protobuf.InvalidProtocolBufferException { 249 return PARSER.parseFrom(data, extensionRegistry); 250 } 251 parseFrom( com.google.protobuf.ByteString data)252 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 253 com.google.protobuf.ByteString data) 254 throws com.google.protobuf.InvalidProtocolBufferException { 255 return PARSER.parseFrom(data); 256 } 257 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)258 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 259 com.google.protobuf.ByteString data, 260 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 261 throws com.google.protobuf.InvalidProtocolBufferException { 262 return PARSER.parseFrom(data, extensionRegistry); 263 } 264 parseFrom(byte[] data)265 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom(byte[] data) 266 throws com.google.protobuf.InvalidProtocolBufferException { 267 return PARSER.parseFrom(data); 268 } 269 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)270 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 271 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 272 throws com.google.protobuf.InvalidProtocolBufferException { 273 return PARSER.parseFrom(data, extensionRegistry); 274 } 275 parseFrom( java.io.InputStream input)276 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 277 java.io.InputStream input) throws java.io.IOException { 278 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 279 } 280 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)281 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 282 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 283 throws java.io.IOException { 284 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 285 PARSER, input, extensionRegistry); 286 } 287 parseDelimitedFrom( java.io.InputStream input)288 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom( 289 java.io.InputStream input) throws java.io.IOException { 290 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 291 } 292 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)293 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom( 294 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 295 throws java.io.IOException { 296 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 297 PARSER, input, extensionRegistry); 298 } 299 parseFrom( com.google.protobuf.CodedInputStream input)300 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 301 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 302 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 303 } 304 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)305 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( 306 com.google.protobuf.CodedInputStream input, 307 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 308 throws java.io.IOException { 309 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 310 PARSER, input, extensionRegistry); 311 } 312 313 @java.lang.Override newBuilderForType()314 public Builder newBuilderForType() { 315 return newBuilder(); 316 } 317 newBuilder()318 public static Builder newBuilder() { 319 return DEFAULT_INSTANCE.toBuilder(); 320 } 321 newBuilder(com.google.cloud.speech.v1.SpeakerDiarizationConfig prototype)322 public static Builder newBuilder(com.google.cloud.speech.v1.SpeakerDiarizationConfig prototype) { 323 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 324 } 325 326 @java.lang.Override toBuilder()327 public Builder toBuilder() { 328 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 329 } 330 331 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)332 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 333 Builder builder = new Builder(parent); 334 return builder; 335 } 336 /** 337 * 338 * 339 * <pre> 340 * Config to enable speaker diarization. 341 * </pre> 342 * 343 * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} 344 */ 345 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 346 implements 347 // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) 348 com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder { getDescriptor()349 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 350 return com.google.cloud.speech.v1.SpeechProto 351 .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; 352 } 353 354 @java.lang.Override 355 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()356 internalGetFieldAccessorTable() { 357 return com.google.cloud.speech.v1.SpeechProto 358 .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable 359 .ensureFieldAccessorsInitialized( 360 com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, 361 com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); 362 } 363 364 // Construct using com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder() Builder()365 private Builder() {} 366 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)367 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 368 super(parent); 369 } 370 371 @java.lang.Override clear()372 public Builder clear() { 373 super.clear(); 374 bitField0_ = 0; 375 enableSpeakerDiarization_ = false; 376 minSpeakerCount_ = 0; 377 maxSpeakerCount_ = 0; 378 speakerTag_ = 0; 379 return this; 380 } 381 382 @java.lang.Override getDescriptorForType()383 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 384 return com.google.cloud.speech.v1.SpeechProto 385 .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; 386 } 387 388 @java.lang.Override getDefaultInstanceForType()389 public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { 390 return com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance(); 391 } 392 393 @java.lang.Override build()394 public com.google.cloud.speech.v1.SpeakerDiarizationConfig build() { 395 com.google.cloud.speech.v1.SpeakerDiarizationConfig result = buildPartial(); 396 if (!result.isInitialized()) { 397 throw newUninitializedMessageException(result); 398 } 399 return result; 400 } 401 402 @java.lang.Override buildPartial()403 public com.google.cloud.speech.v1.SpeakerDiarizationConfig buildPartial() { 404 com.google.cloud.speech.v1.SpeakerDiarizationConfig result = 405 new com.google.cloud.speech.v1.SpeakerDiarizationConfig(this); 406 if (bitField0_ != 0) { 407 buildPartial0(result); 408 } 409 onBuilt(); 410 return result; 411 } 412 buildPartial0(com.google.cloud.speech.v1.SpeakerDiarizationConfig result)413 private void buildPartial0(com.google.cloud.speech.v1.SpeakerDiarizationConfig result) { 414 int from_bitField0_ = bitField0_; 415 if (((from_bitField0_ & 0x00000001) != 0)) { 416 result.enableSpeakerDiarization_ = enableSpeakerDiarization_; 417 } 418 if (((from_bitField0_ & 0x00000002) != 0)) { 419 result.minSpeakerCount_ = minSpeakerCount_; 420 } 421 if (((from_bitField0_ & 0x00000004) != 0)) { 422 result.maxSpeakerCount_ = maxSpeakerCount_; 423 } 424 if (((from_bitField0_ & 0x00000008) != 0)) { 425 result.speakerTag_ = speakerTag_; 426 } 427 } 428 429 @java.lang.Override clone()430 public Builder clone() { 431 return super.clone(); 432 } 433 434 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)435 public Builder setField( 436 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 437 return super.setField(field, value); 438 } 439 440 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)441 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 442 return super.clearField(field); 443 } 444 445 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)446 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 447 return super.clearOneof(oneof); 448 } 449 450 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)451 public Builder setRepeatedField( 452 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 453 return super.setRepeatedField(field, index, value); 454 } 455 456 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)457 public Builder addRepeatedField( 458 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 459 return super.addRepeatedField(field, value); 460 } 461 462 @java.lang.Override mergeFrom(com.google.protobuf.Message other)463 public Builder mergeFrom(com.google.protobuf.Message other) { 464 if (other instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig) { 465 return mergeFrom((com.google.cloud.speech.v1.SpeakerDiarizationConfig) other); 466 } else { 467 super.mergeFrom(other); 468 return this; 469 } 470 } 471 mergeFrom(com.google.cloud.speech.v1.SpeakerDiarizationConfig other)472 public Builder mergeFrom(com.google.cloud.speech.v1.SpeakerDiarizationConfig other) { 473 if (other == com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance()) 474 return this; 475 if (other.getEnableSpeakerDiarization() != false) { 476 setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); 477 } 478 if (other.getMinSpeakerCount() != 0) { 479 setMinSpeakerCount(other.getMinSpeakerCount()); 480 } 481 if (other.getMaxSpeakerCount() != 0) { 482 setMaxSpeakerCount(other.getMaxSpeakerCount()); 483 } 484 if (other.getSpeakerTag() != 0) { 485 setSpeakerTag(other.getSpeakerTag()); 486 } 487 this.mergeUnknownFields(other.getUnknownFields()); 488 onChanged(); 489 return this; 490 } 491 492 @java.lang.Override isInitialized()493 public final boolean isInitialized() { 494 return true; 495 } 496 497 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)498 public Builder mergeFrom( 499 com.google.protobuf.CodedInputStream input, 500 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 501 throws java.io.IOException { 502 if (extensionRegistry == null) { 503 throw new java.lang.NullPointerException(); 504 } 505 try { 506 boolean done = false; 507 while (!done) { 508 int tag = input.readTag(); 509 switch (tag) { 510 case 0: 511 done = true; 512 break; 513 case 8: 514 { 515 enableSpeakerDiarization_ = input.readBool(); 516 bitField0_ |= 0x00000001; 517 break; 518 } // case 8 519 case 16: 520 { 521 minSpeakerCount_ = input.readInt32(); 522 bitField0_ |= 0x00000002; 523 break; 524 } // case 16 525 case 24: 526 { 527 maxSpeakerCount_ = input.readInt32(); 528 bitField0_ |= 0x00000004; 529 break; 530 } // case 24 531 case 40: 532 { 533 speakerTag_ = input.readInt32(); 534 bitField0_ |= 0x00000008; 535 break; 536 } // case 40 537 default: 538 { 539 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 540 done = true; // was an endgroup tag 541 } 542 break; 543 } // default: 544 } // switch (tag) 545 } // while (!done) 546 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 547 throw e.unwrapIOException(); 548 } finally { 549 onChanged(); 550 } // finally 551 return this; 552 } 553 554 private int bitField0_; 555 556 private boolean enableSpeakerDiarization_; 557 /** 558 * 559 * 560 * <pre> 561 * If 'true', enables speaker detection for each recognized word in 562 * the top alternative of the recognition result using a speaker_tag provided 563 * in the WordInfo. 564 * </pre> 565 * 566 * <code>bool enable_speaker_diarization = 1;</code> 567 * 568 * @return The enableSpeakerDiarization. 569 */ 570 @java.lang.Override getEnableSpeakerDiarization()571 public boolean getEnableSpeakerDiarization() { 572 return enableSpeakerDiarization_; 573 } 574 /** 575 * 576 * 577 * <pre> 578 * If 'true', enables speaker detection for each recognized word in 579 * the top alternative of the recognition result using a speaker_tag provided 580 * in the WordInfo. 581 * </pre> 582 * 583 * <code>bool enable_speaker_diarization = 1;</code> 584 * 585 * @param value The enableSpeakerDiarization to set. 586 * @return This builder for chaining. 587 */ setEnableSpeakerDiarization(boolean value)588 public Builder setEnableSpeakerDiarization(boolean value) { 589 590 enableSpeakerDiarization_ = value; 591 bitField0_ |= 0x00000001; 592 onChanged(); 593 return this; 594 } 595 /** 596 * 597 * 598 * <pre> 599 * If 'true', enables speaker detection for each recognized word in 600 * the top alternative of the recognition result using a speaker_tag provided 601 * in the WordInfo. 602 * </pre> 603 * 604 * <code>bool enable_speaker_diarization = 1;</code> 605 * 606 * @return This builder for chaining. 607 */ clearEnableSpeakerDiarization()608 public Builder clearEnableSpeakerDiarization() { 609 bitField0_ = (bitField0_ & ~0x00000001); 610 enableSpeakerDiarization_ = false; 611 onChanged(); 612 return this; 613 } 614 615 private int minSpeakerCount_; 616 /** 617 * 618 * 619 * <pre> 620 * Minimum number of speakers in the conversation. This range gives you more 621 * flexibility by allowing the system to automatically determine the correct 622 * number of speakers. If not set, the default value is 2. 623 * </pre> 624 * 625 * <code>int32 min_speaker_count = 2;</code> 626 * 627 * @return The minSpeakerCount. 628 */ 629 @java.lang.Override getMinSpeakerCount()630 public int getMinSpeakerCount() { 631 return minSpeakerCount_; 632 } 633 /** 634 * 635 * 636 * <pre> 637 * Minimum number of speakers in the conversation. This range gives you more 638 * flexibility by allowing the system to automatically determine the correct 639 * number of speakers. If not set, the default value is 2. 640 * </pre> 641 * 642 * <code>int32 min_speaker_count = 2;</code> 643 * 644 * @param value The minSpeakerCount to set. 645 * @return This builder for chaining. 646 */ setMinSpeakerCount(int value)647 public Builder setMinSpeakerCount(int value) { 648 649 minSpeakerCount_ = value; 650 bitField0_ |= 0x00000002; 651 onChanged(); 652 return this; 653 } 654 /** 655 * 656 * 657 * <pre> 658 * Minimum number of speakers in the conversation. This range gives you more 659 * flexibility by allowing the system to automatically determine the correct 660 * number of speakers. If not set, the default value is 2. 661 * </pre> 662 * 663 * <code>int32 min_speaker_count = 2;</code> 664 * 665 * @return This builder for chaining. 666 */ clearMinSpeakerCount()667 public Builder clearMinSpeakerCount() { 668 bitField0_ = (bitField0_ & ~0x00000002); 669 minSpeakerCount_ = 0; 670 onChanged(); 671 return this; 672 } 673 674 private int maxSpeakerCount_; 675 /** 676 * 677 * 678 * <pre> 679 * Maximum number of speakers in the conversation. This range gives you more 680 * flexibility by allowing the system to automatically determine the correct 681 * number of speakers. If not set, the default value is 6. 682 * </pre> 683 * 684 * <code>int32 max_speaker_count = 3;</code> 685 * 686 * @return The maxSpeakerCount. 687 */ 688 @java.lang.Override getMaxSpeakerCount()689 public int getMaxSpeakerCount() { 690 return maxSpeakerCount_; 691 } 692 /** 693 * 694 * 695 * <pre> 696 * Maximum number of speakers in the conversation. This range gives you more 697 * flexibility by allowing the system to automatically determine the correct 698 * number of speakers. If not set, the default value is 6. 699 * </pre> 700 * 701 * <code>int32 max_speaker_count = 3;</code> 702 * 703 * @param value The maxSpeakerCount to set. 704 * @return This builder for chaining. 705 */ setMaxSpeakerCount(int value)706 public Builder setMaxSpeakerCount(int value) { 707 708 maxSpeakerCount_ = value; 709 bitField0_ |= 0x00000004; 710 onChanged(); 711 return this; 712 } 713 /** 714 * 715 * 716 * <pre> 717 * Maximum number of speakers in the conversation. This range gives you more 718 * flexibility by allowing the system to automatically determine the correct 719 * number of speakers. If not set, the default value is 6. 720 * </pre> 721 * 722 * <code>int32 max_speaker_count = 3;</code> 723 * 724 * @return This builder for chaining. 725 */ clearMaxSpeakerCount()726 public Builder clearMaxSpeakerCount() { 727 bitField0_ = (bitField0_ & ~0x00000004); 728 maxSpeakerCount_ = 0; 729 onChanged(); 730 return this; 731 } 732 733 private int speakerTag_; 734 /** 735 * 736 * 737 * <pre> 738 * Output only. Unused. 739 * </pre> 740 * 741 * <code>int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; 742 * </code> 743 * 744 * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See 745 * google/cloud/speech/v1/cloud_speech.proto;l=480 746 * @return The speakerTag. 747 */ 748 @java.lang.Override 749 @java.lang.Deprecated getSpeakerTag()750 public int getSpeakerTag() { 751 return speakerTag_; 752 } 753 /** 754 * 755 * 756 * <pre> 757 * Output only. Unused. 758 * </pre> 759 * 760 * <code>int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; 761 * </code> 762 * 763 * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See 764 * google/cloud/speech/v1/cloud_speech.proto;l=480 765 * @param value The speakerTag to set. 766 * @return This builder for chaining. 767 */ 768 @java.lang.Deprecated setSpeakerTag(int value)769 public Builder setSpeakerTag(int value) { 770 771 speakerTag_ = value; 772 bitField0_ |= 0x00000008; 773 onChanged(); 774 return this; 775 } 776 /** 777 * 778 * 779 * <pre> 780 * Output only. Unused. 781 * </pre> 782 * 783 * <code>int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; 784 * </code> 785 * 786 * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See 787 * google/cloud/speech/v1/cloud_speech.proto;l=480 788 * @return This builder for chaining. 789 */ 790 @java.lang.Deprecated clearSpeakerTag()791 public Builder clearSpeakerTag() { 792 bitField0_ = (bitField0_ & ~0x00000008); 793 speakerTag_ = 0; 794 onChanged(); 795 return this; 796 } 797 798 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)799 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 800 return super.setUnknownFields(unknownFields); 801 } 802 803 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)804 public final Builder mergeUnknownFields( 805 final com.google.protobuf.UnknownFieldSet unknownFields) { 806 return super.mergeUnknownFields(unknownFields); 807 } 808 809 // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) 810 } 811 812 // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) 813 private static final com.google.cloud.speech.v1.SpeakerDiarizationConfig DEFAULT_INSTANCE; 814 815 static { 816 DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(); 817 } 818 getDefaultInstance()819 public static com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstance() { 820 return DEFAULT_INSTANCE; 821 } 822 823 private static final com.google.protobuf.Parser<SpeakerDiarizationConfig> PARSER = 824 new com.google.protobuf.AbstractParser<SpeakerDiarizationConfig>() { 825 @java.lang.Override 826 public SpeakerDiarizationConfig parsePartialFrom( 827 com.google.protobuf.CodedInputStream input, 828 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 829 throws com.google.protobuf.InvalidProtocolBufferException { 830 Builder builder = newBuilder(); 831 try { 832 builder.mergeFrom(input, extensionRegistry); 833 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 834 throw e.setUnfinishedMessage(builder.buildPartial()); 835 } catch (com.google.protobuf.UninitializedMessageException e) { 836 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 837 } catch (java.io.IOException e) { 838 throw new com.google.protobuf.InvalidProtocolBufferException(e) 839 .setUnfinishedMessage(builder.buildPartial()); 840 } 841 return builder.buildPartial(); 842 } 843 }; 844 parser()845 public static com.google.protobuf.Parser<SpeakerDiarizationConfig> parser() { 846 return PARSER; 847 } 848 849 @java.lang.Override getParserForType()850 public com.google.protobuf.Parser<SpeakerDiarizationConfig> getParserForType() { 851 return PARSER; 852 } 853 854 @java.lang.Override getDefaultInstanceForType()855 public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { 856 return DEFAULT_INSTANCE; 857 } 858 } 859