public final class RecognitionConfig extends GeneratedMessageV3 implements RecognitionConfigOrBuilder
Provides information to the recognizer that specifies how to process the request.Protobuf type
google.cloud.speech.v1beta1.RecognitionConfig| Modifier and Type | Class and Description |
|---|---|
static class |
RecognitionConfig.AudioEncoding
Audio encoding of the data sent in the audio message.
|
static class |
RecognitionConfig.Builder
Provides information to the recognizer that specifies how to process the
request.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
ENCODING_FIELD_NUMBER |
static int |
LANGUAGE_CODE_FIELD_NUMBER |
static int |
MAX_ALTERNATIVES_FIELD_NUMBER |
static int |
PROFANITY_FILTER_FIELD_NUMBER |
static int |
SAMPLE_RATE_FIELD_NUMBER |
static int |
SPEECH_CONTEXT_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static RecognitionConfig |
getDefaultInstance() |
RecognitionConfig |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
RecognitionConfig.AudioEncoding |
getEncoding()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
|
int |
getEncodingValue()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
|
java.lang.String |
getLanguageCode()
*Optional* The language of the supplied audio as a BCP-47 language tag.
|
ByteString |
getLanguageCodeBytes()
*Optional* The language of the supplied audio as a BCP-47 language tag.
|
int |
getMaxAlternatives()
*Optional* Maximum number of recognition hypotheses to be returned.
|
Parser<RecognitionConfig> |
getParserForType() |
boolean |
getProfanityFilter()
*Optional* If set to `true`, the server will attempt to filter out
profanities, replacing all but the initial character in each filtered word
with asterisks, e.g.
|
int |
getSampleRate()
*Required* Sample rate in Hertz of the audio data sent in all
`RecognitionAudio` messages.
|
int |
getSerializedSize() |
SpeechContext |
getSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
|
SpeechContextOrBuilder |
getSpeechContextOrBuilder()
*Optional* A means to provide context to assist the speech recognition.
|
UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static RecognitionConfig.Builder |
newBuilder() |
static RecognitionConfig.Builder |
newBuilder(RecognitionConfig prototype) |
RecognitionConfig.Builder |
newBuilderForType() |
protected RecognitionConfig.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static RecognitionConfig |
parseDelimitedFrom(java.io.InputStream input) |
static RecognitionConfig |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(byte[] data) |
static RecognitionConfig |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(java.nio.ByteBuffer data) |
static RecognitionConfig |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(ByteString data) |
static RecognitionConfig |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(CodedInputStream input) |
static RecognitionConfig |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(java.io.InputStream input) |
static RecognitionConfig |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<RecognitionConfig> |
parser() |
RecognitionConfig.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int ENCODING_FIELD_NUMBER
public static final int SAMPLE_RATE_FIELD_NUMBER
public static final int LANGUAGE_CODE_FIELD_NUMBER
public static final int MAX_ALTERNATIVES_FIELD_NUMBER
public static final int PROFANITY_FILTER_FIELD_NUMBER
public static final int SPEECH_CONTEXT_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3public int getEncodingValue()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;getEncodingValue in interface RecognitionConfigOrBuilderpublic RecognitionConfig.AudioEncoding getEncoding()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;getEncoding in interface RecognitionConfigOrBuilderpublic int getSampleRate()
*Required* Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).
int32 sample_rate = 2;getSampleRate in interface RecognitionConfigOrBuilderpublic java.lang.String getLanguageCode()
*Optional* The language of the supplied audio as a BCP-47 language tag. Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt If omitted, defaults to "en-US". See [Language Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported language codes.
string language_code = 3;getLanguageCode in interface RecognitionConfigOrBuilderpublic ByteString getLanguageCodeBytes()
*Optional* The language of the supplied audio as a BCP-47 language tag. Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt If omitted, defaults to "en-US". See [Language Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported language codes.
string language_code = 3;getLanguageCodeBytes in interface RecognitionConfigOrBuilderpublic int getMaxAlternatives()
*Optional* Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of `SpeechRecognitionAlternative` messages within each `SpeechRecognitionResult`. The server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one. If omitted, will return a maximum of one.
int32 max_alternatives = 4;getMaxAlternatives in interface RecognitionConfigOrBuilderpublic boolean getProfanityFilter()
*Optional* If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, e.g. "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 5;getProfanityFilter in interface RecognitionConfigOrBuilderpublic boolean hasSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;hasSpeechContext in interface RecognitionConfigOrBuilderpublic SpeechContext getSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;getSpeechContext in interface RecognitionConfigOrBuilderpublic SpeechContextOrBuilder getSpeechContextOrBuilder()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;getSpeechContextOrBuilder in interface RecognitionConfigOrBuilderpublic final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface Messageequals in class AbstractMessagepublic int hashCode()
hashCode in interface MessagehashCode in class AbstractMessagepublic static RecognitionConfig parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic RecognitionConfig.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static RecognitionConfig.Builder newBuilder()
public static RecognitionConfig.Builder newBuilder(RecognitionConfig prototype)
public RecognitionConfig.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected RecognitionConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static RecognitionConfig getDefaultInstance()
public static Parser<RecognitionConfig> parser()
public Parser<RecognitionConfig> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public RecognitionConfig getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder