public final class RecognitionConfig
extends com.google.api.client.json.GenericJson
This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the Cloud Speech-to-Text API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json
com.google.api.client.util.GenericData.Flags
Constructor and Description |
---|
RecognitionConfig() |
Modifier and Type | Method and Description |
---|---|
RecognitionConfig |
clone() |
java.lang.Integer |
getAudioChannelCount()
The number of channels in the input audio data.
|
SpeakerDiarizationConfig |
getDiarizationConfig()
Config to enable speaker diarization and set additional parameters to make diarization better
suited for your application.
|
java.lang.Boolean |
getEnableAutomaticPunctuation()
If 'true', adds punctuation to recognition result hypotheses.
|
java.lang.Boolean |
getEnableSeparateRecognitionPerChannel()
This needs to be set to `true` explicitly and `audio_channel_count` > 1 to get each channel
recognized separately.
|
java.lang.Boolean |
getEnableWordTimeOffsets()
If `true`, the top result includes a list of words and the start and end time offsets
(timestamps) for those words.
|
java.lang.String |
getEncoding()
Encoding of audio data sent in all `RecognitionAudio` messages.
|
java.lang.String |
getLanguageCode()
Required.
|
java.lang.Integer |
getMaxAlternatives()
Maximum number of recognition hypotheses to be returned.
|
RecognitionMetadata |
getMetadata()
Metadata regarding this request.
|
java.lang.String |
getModel()
Which model to select for the given request.
|
java.lang.Boolean |
getProfanityFilter()
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.
|
java.lang.Integer |
getSampleRateHertz()
Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages.
|
java.util.List<SpeechContext> |
getSpeechContexts()
Array of SpeechContext.
|
java.lang.Boolean |
getUseEnhanced()
Set to true to use an enhanced model for speech recognition.
|
RecognitionConfig |
set(java.lang.String fieldName,
java.lang.Object value) |
RecognitionConfig |
setAudioChannelCount(java.lang.Integer audioChannelCount)
The number of channels in the input audio data.
|
RecognitionConfig |
setDiarizationConfig(SpeakerDiarizationConfig diarizationConfig)
Config to enable speaker diarization and set additional parameters to make diarization better
suited for your application.
|
RecognitionConfig |
setEnableAutomaticPunctuation(java.lang.Boolean enableAutomaticPunctuation)
If 'true', adds punctuation to recognition result hypotheses.
|
RecognitionConfig |
setEnableSeparateRecognitionPerChannel(java.lang.Boolean enableSeparateRecognitionPerChannel)
This needs to be set to `true` explicitly and `audio_channel_count` > 1 to get each channel
recognized separately.
|
RecognitionConfig |
setEnableWordTimeOffsets(java.lang.Boolean enableWordTimeOffsets)
If `true`, the top result includes a list of words and the start and end time offsets
(timestamps) for those words.
|
RecognitionConfig |
setEncoding(java.lang.String encoding)
Encoding of audio data sent in all `RecognitionAudio` messages.
|
RecognitionConfig |
setLanguageCode(java.lang.String languageCode)
Required.
|
RecognitionConfig |
setMaxAlternatives(java.lang.Integer maxAlternatives)
Maximum number of recognition hypotheses to be returned.
|
RecognitionConfig |
setMetadata(RecognitionMetadata metadata)
Metadata regarding this request.
|
RecognitionConfig |
setModel(java.lang.String model)
Which model to select for the given request.
|
RecognitionConfig |
setProfanityFilter(java.lang.Boolean profanityFilter)
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.
|
RecognitionConfig |
setSampleRateHertz(java.lang.Integer sampleRateHertz)
Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages.
|
RecognitionConfig |
setSpeechContexts(java.util.List<SpeechContext> speechContexts)
Array of SpeechContext.
|
RecognitionConfig |
setUseEnhanced(java.lang.Boolean useEnhanced)
Set to true to use an enhanced model for speech recognition.
|
getFactory, setFactory, toPrettyString, toString
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
public java.lang.Integer getAudioChannelCount()
null
for nonepublic RecognitionConfig setAudioChannelCount(java.lang.Integer audioChannelCount)
audioChannelCount
- audioChannelCount or null
for nonepublic SpeakerDiarizationConfig getDiarizationConfig()
null
for nonepublic RecognitionConfig setDiarizationConfig(SpeakerDiarizationConfig diarizationConfig)
diarizationConfig
- diarizationConfig or null
for nonepublic java.lang.Boolean getEnableAutomaticPunctuation()
null
for nonepublic RecognitionConfig setEnableAutomaticPunctuation(java.lang.Boolean enableAutomaticPunctuation)
enableAutomaticPunctuation
- enableAutomaticPunctuation or null
for nonepublic java.lang.Boolean getEnableSeparateRecognitionPerChannel()
null
for nonepublic RecognitionConfig setEnableSeparateRecognitionPerChannel(java.lang.Boolean enableSeparateRecognitionPerChannel)
enableSeparateRecognitionPerChannel
- enableSeparateRecognitionPerChannel or null
for nonepublic java.lang.Boolean getEnableWordTimeOffsets()
null
for nonepublic RecognitionConfig setEnableWordTimeOffsets(java.lang.Boolean enableWordTimeOffsets)
enableWordTimeOffsets
- enableWordTimeOffsets or null
for nonepublic java.lang.String getEncoding()
null
for nonepublic RecognitionConfig setEncoding(java.lang.String encoding)
encoding
- encoding or null
for nonepublic java.lang.String getLanguageCode()
null
for nonepublic RecognitionConfig setLanguageCode(java.lang.String languageCode)
languageCode
- languageCode or null
for nonepublic java.lang.Integer getMaxAlternatives()
null
for nonepublic RecognitionConfig setMaxAlternatives(java.lang.Integer maxAlternatives)
maxAlternatives
- maxAlternatives or null
for nonepublic RecognitionMetadata getMetadata()
null
for nonepublic RecognitionConfig setMetadata(RecognitionMetadata metadata)
metadata
- metadata or null
for nonepublic java.lang.String getModel()
null
for nonepublic RecognitionConfig setModel(java.lang.String model)
model
- model or null
for nonepublic java.lang.Boolean getProfanityFilter()
null
for nonepublic RecognitionConfig setProfanityFilter(java.lang.Boolean profanityFilter)
profanityFilter
- profanityFilter or null
for nonepublic java.lang.Integer getSampleRateHertz()
null
for nonepublic RecognitionConfig setSampleRateHertz(java.lang.Integer sampleRateHertz)
sampleRateHertz
- sampleRateHertz or null
for nonepublic java.util.List<SpeechContext> getSpeechContexts()
null
for nonepublic RecognitionConfig setSpeechContexts(java.util.List<SpeechContext> speechContexts)
speechContexts
- speechContexts or null
for nonepublic java.lang.Boolean getUseEnhanced()
null
for nonepublic RecognitionConfig setUseEnhanced(java.lang.Boolean useEnhanced)
useEnhanced
- useEnhanced or null
for nonepublic RecognitionConfig set(java.lang.String fieldName, java.lang.Object value)
set
in class com.google.api.client.json.GenericJson
public RecognitionConfig clone()
clone
in class com.google.api.client.json.GenericJson