public final class RecognitionConfig extends com.google.protobuf.GeneratedMessageV3 implements RecognitionConfigOrBuilder
The `RecognitionConfig` message 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
The `RecognitionConfig` message provides information to the recognizer
that specifies how to process the request.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.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 |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static RecognitionConfig |
getDefaultInstance() |
RecognitionConfig |
getDefaultInstanceForType() |
static com.google.protobuf.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.
|
com.google.protobuf.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.
|
com.google.protobuf.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.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasSpeechContext()
[Optional] A means to provide context to assist the speech recognition.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static RecognitionConfig.Builder |
newBuilder() |
static RecognitionConfig.Builder |
newBuilder(RecognitionConfig prototype) |
RecognitionConfig.Builder |
newBuilderForType() |
protected RecognitionConfig.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static RecognitionConfig |
parseDelimitedFrom(java.io.InputStream input) |
static RecognitionConfig |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(byte[] data) |
static RecognitionConfig |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(com.google.protobuf.ByteString data) |
static RecognitionConfig |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(com.google.protobuf.CodedInputStream input) |
static RecognitionConfig |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RecognitionConfig |
parseFrom(java.io.InputStream input) |
static RecognitionConfig |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<RecognitionConfig> |
parser() |
RecognitionConfig.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic 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 com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public int getEncodingValue()
[Required] Encoding of audio data sent in all `RecognitionAudio` messages.
optional .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.
optional .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).
optional 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/best-practices#language_support) for a list of the currently supported language codes.
optional string language_code = 3;getLanguageCode in interface RecognitionConfigOrBuilderpublic com.google.protobuf.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/best-practices#language_support) for a list of the currently supported language codes.
optional 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 `1`. If omitted, defaults to `1`.
optional 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.
optional bool profanity_filter = 5;getProfanityFilter in interface RecognitionConfigOrBuilderpublic boolean hasSpeechContext()
[Optional] A means to provide context to assist the speech recognition.
optional .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.
optional .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.
optional .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;getSpeechContextOrBuilder in interface RecognitionConfigOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static RecognitionConfig parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RecognitionConfig parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(java.io.InputStream input, com.google.protobuf.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, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RecognitionConfig parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic RecognitionConfig.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static RecognitionConfig.Builder newBuilder()
public static RecognitionConfig.Builder newBuilder(RecognitionConfig prototype)
public RecognitionConfig.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected RecognitionConfig.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static RecognitionConfig getDefaultInstance()
public static com.google.protobuf.Parser<RecognitionConfig> parser()
public com.google.protobuf.Parser<RecognitionConfig> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public RecognitionConfig getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder