Cloud Speech V2 Client - Class RecognitionConfig (1.14.3)

Reference documentation and code samples for the Cloud Speech V2 Client class RecognitionConfig.

Provides information to the Recognizer that specifies how to process the recognition request.

Generated from protobuf message google.cloud.speech.v2.RecognitionConfig

Namespace

Google \ Cloud \ Speech \ V2

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ auto_decoding_config Google\Cloud\Speech\V2\AutoDetectDecodingConfig

Automatically detect decoding parameters. Preferred for supported formats.

↳ explicit_decoding_config Google\Cloud\Speech\V2\ExplicitDecodingConfig

Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw).

↳ model string

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results. Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

↳ language_codes array

Optional. The language of the supplied audio as a BCP-47 language tag. Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

↳ features Google\Cloud\Speech\V2\RecognitionFeatures

Speech recognition features to enable.

↳ adaptation Google\Cloud\Speech\V2\SpeechAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

getAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

Returns
TypeDescription
Google\Cloud\Speech\V2\AutoDetectDecodingConfig|null

hasAutoDecodingConfig

setAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

Parameter
NameDescription
var Google\Cloud\Speech\V2\AutoDetectDecodingConfig
Returns
TypeDescription
$this

getExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

Returns
TypeDescription
Google\Cloud\Speech\V2\ExplicitDecodingConfig|null

hasExplicitDecodingConfig

setExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

Parameter
NameDescription
var Google\Cloud\Speech\V2\ExplicitDecodingConfig
Returns
TypeDescription
$this

getModel

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

Returns
TypeDescription
string

setModel

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLanguageCodes

Optional. The language of the supplied audio as a BCP-47 language tag.

Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setLanguageCodes

Optional. The language of the supplied audio as a BCP-47 language tag.

Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getFeatures

Speech recognition features to enable.

Returns
TypeDescription
Google\Cloud\Speech\V2\RecognitionFeatures|null

hasFeatures

clearFeatures

setFeatures

Speech recognition features to enable.

Parameter
NameDescription
var Google\Cloud\Speech\V2\RecognitionFeatures
Returns
TypeDescription
$this

getAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

Returns
TypeDescription
Google\Cloud\Speech\V2\SpeechAdaptation|null

hasAdaptation

clearAdaptation

setAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

Parameter
NameDescription
var Google\Cloud\Speech\V2\SpeechAdaptation
Returns
TypeDescription
$this

getDecodingConfig

Returns
TypeDescription
string