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, unknownFields
memoizedSize
memoizedHashCode
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, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public 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 MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public int getEncodingValue()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
getEncodingValue
in interface RecognitionConfigOrBuilder
public RecognitionConfig.AudioEncoding getEncoding()
*Required* Encoding of audio data sent in all `RecognitionAudio` messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
getEncoding
in interface RecognitionConfigOrBuilder
public 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 RecognitionConfigOrBuilder
public 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 RecognitionConfigOrBuilder
public 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 RecognitionConfigOrBuilder
public 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 RecognitionConfigOrBuilder
public 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 RecognitionConfigOrBuilder
public boolean hasSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
hasSpeechContext
in interface RecognitionConfigOrBuilder
public SpeechContext getSpeechContext()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
getSpeechContext
in interface RecognitionConfigOrBuilder
public SpeechContextOrBuilder getSpeechContextOrBuilder()
*Optional* A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
getSpeechContextOrBuilder
in interface RecognitionConfigOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static RecognitionConfig parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static RecognitionConfig parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static RecognitionConfig parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static RecognitionConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static RecognitionConfig parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static RecognitionConfig parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static RecognitionConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public RecognitionConfig.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static RecognitionConfig.Builder newBuilder()
public static RecognitionConfig.Builder newBuilder(RecognitionConfig prototype)
public RecognitionConfig.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected RecognitionConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static RecognitionConfig getDefaultInstance()
public static Parser<RecognitionConfig> parser()
public Parser<RecognitionConfig> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public RecognitionConfig getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder