RecognitionConfig
class RecognitionConfig extends Message
Provides information to the recognizer that specifies how to process the request.
Protobuf type Google\Cloud\Speech\V1\RecognitionConfig
Methods
No description
Required Encoding of audio data sent in all RecognitionAudio
messages.
Required Encoding of audio data sent in all RecognitionAudio
messages.
Required Sample rate in Hertz of the audio data sent in all
RecognitionAudio
messages. Valid values are: 8000-48000.
Required Sample rate in Hertz of the audio data sent in all
RecognitionAudio
messages. Valid values are: 8000-48000.
Required The language of the supplied audio as a BCP-47 language tag.
Required The language of the supplied audio as a BCP-47 language tag.
Optional Maximum number of recognition hypotheses to be returned.
Optional Maximum number of recognition hypotheses to be returned.
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 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 A means to provide context to assist the speech recognition.
Optional A means to provide context to assist the speech recognition.
Details
at line 72
__construct()
at line 83
int
getEncoding()
Required Encoding of audio data sent in all RecognitionAudio
messages.
Generated from protobuf field .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1;
at line 94
setEncoding(int $var)
Required Encoding of audio data sent in all RecognitionAudio
messages.
Generated from protobuf field .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1;
at line 110
int
getSampleRateHertz()
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).
Generated from protobuf field int32 sample_rate_hertz = 2;
at line 125
setSampleRateHertz(int $var)
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).
Generated from protobuf field int32 sample_rate_hertz = 2;
at line 141
string
getLanguageCode()
Required The language of the supplied audio as a BCP-47 language tag.
Example: "en-US". See Language Support for a list of the currently supported language codes.
Generated from protobuf field string language_code = 3;
at line 156
setLanguageCode(string $var)
Required The language of the supplied audio as a BCP-47 language tag.
Example: "en-US". See Language Support for a list of the currently supported language codes.
Generated from protobuf field string language_code = 3;
at line 173
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.
Generated from protobuf field int32 max_alternatives = 4;
at line 189
setMaxAlternatives(int $var)
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.
Generated from protobuf field int32 max_alternatives = 4;
at line 204
bool
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.
Generated from protobuf field bool profanity_filter = 5;
at line 218
setProfanityFilter(bool $var)
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.
Generated from protobuf field bool profanity_filter = 5;
at line 230
RepeatedField
getSpeechContexts()
Optional A means to provide context to assist the speech recognition.
Generated from protobuf field repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6;
at line 241
setSpeechContexts(array|RepeatedField $var)
Optional A means to provide context to assist the speech recognition.
Generated from protobuf field repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6;