/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder clearAlternatives() { if (alternativesBuilder_ == null) { alternatives_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { alternativesBuilder_.clear(); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { if (alternativesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlternativesIsMutable(); alternatives_.add(value); onChanged(); } else { alternativesBuilder_.addMessage(value); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder addAlternatives( int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { if (alternativesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlternativesIsMutable(); alternatives_.add(index, value); onChanged(); } else { alternativesBuilder_.addMessage(index, value); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder setAlternatives( int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { if (alternativesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlternativesIsMutable(); alternatives_.set(index, value); onChanged(); } else { alternativesBuilder_.setMessage(index, value); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder setAlternatives( int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { if (alternativesBuilder_ == null) { ensureAlternativesIsMutable(); alternatives_.set(index, builderForValue.build()); onChanged(); } else { alternativesBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder addAlternatives( com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { if (alternativesBuilder_ == null) { ensureAlternativesIsMutable(); alternatives_.add(builderForValue.build()); onChanged(); } else { alternativesBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder removeAlternatives(int index) { if (alternativesBuilder_ == null) { ensureAlternativesIsMutable(); alternatives_.remove(index); onChanged(); } else { alternativesBuilder_.remove(index); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder addAllAlternatives( java.lang.Iterable<? extends com.google.cloud.speech.v1.SpeechRecognitionAlternative> values) { if (alternativesBuilder_ == null) { ensureAlternativesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); onChanged(); } else { alternativesBuilder_.addAllMessages(values); } return this; } /**
/** * * * <pre> * Output only. May contain one or more recognition hypotheses (up to the * maximum specified in `max_alternatives`). * These alternatives are ordered in terms of accuracy, with the top (first) * alternative being the most probable, as ranked by the recognizer. * </pre> * * <code>repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;</code> */ public Builder addAlternatives( int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { if (alternativesBuilder_ == null) { ensureAlternativesIsMutable(); alternatives_.add(index, builderForValue.build()); onChanged(); } else { alternativesBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Output only. If `false`, this `StreamingRecognitionResult` represents an * interim result that may change. If `true`, this is the final time the * speech service will return this particular `StreamingRecognitionResult`, * the recognizer will not return any further hypotheses for this portion of * the transcript and corresponding audio. * </pre> * * <code>bool is_final = 2;</code> */ public Builder setIsFinal(boolean value) { isFinal_ = value; onChanged(); return this; } /**
/** * * * <pre> * Output only. If `false`, this `StreamingRecognitionResult` represents an * interim result that may change. If `true`, this is the final time the * speech service will return this particular `StreamingRecognitionResult`, * the recognizer will not return any further hypotheses for this portion of * the transcript and corresponding audio. * </pre> * * <code>bool is_final = 2;</code> */ public Builder clearIsFinal() { isFinal_ = false; onChanged(); return this; }
/** * * * <pre> * For multi-channel audio, this is the channel number corresponding to the * recognized result for the audio from that channel. * For audio_channel_count = N, its output values can range from '1' to 'N'. * </pre> * * <code>int32 channel_tag = 5;</code> */ public Builder setChannelTag(int value) { channelTag_ = value; onChanged(); return this; } /**
/** * * * <pre> * Output only. An estimate of the likelihood that the recognizer will not * change its guess about this interim result. Values range from 0.0 * (completely unstable) to 1.0 (completely stable). * This field is only provided for interim results (`is_final=false`). * The default of 0.0 is a sentinel value indicating `stability` was not set. * </pre> * * <code>float stability = 3;</code> */ public Builder setStability(float value) { stability_ = value; onChanged(); return this; } /**
/** * * * <pre> * Output only. An estimate of the likelihood that the recognizer will not * change its guess about this interim result. Values range from 0.0 * (completely unstable) to 1.0 (completely stable). * This field is only provided for interim results (`is_final=false`). * The default of 0.0 is a sentinel value indicating `stability` was not set. * </pre> * * <code>float stability = 3;</code> */ public Builder clearStability() { stability_ = 0F; onChanged(); return this; }
/** * * * <pre> * For multi-channel audio, this is the channel number corresponding to the * recognized result for the audio from that channel. * For audio_channel_count = N, its output values can range from '1' to 'N'. * </pre> * * <code>int32 channel_tag = 5;</code> */ public Builder clearChannelTag() { channelTag_ = 0; onChanged(); return this; }