Reference documentation and code samples for the Cloud Speech V2 Client class Recognizer.
A Recognizer message. Stores recognition configuration and metadata.
Generated from protobuf message google.cloud.speech.v2.Recognizer
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
Output only. The resource name of the Recognizer. Format: |
↳ uid |
string
Output only. System-assigned unique identifier for the Recognizer. |
↳ display_name |
string
User-settable, human-readable name for the Recognizer. Must be 63 characters or less. |
↳ model |
string
Required. Which model to use for recognition requests. Select the model best suited to your domain to get best results. Supported models: - |
↳ language_codes |
array
Required. The language of the supplied audio as a BCP-47 language tag. Supported languages: - |
↳ default_recognition_config |
Google\Cloud\Speech\V2\RecognitionConfig
Default configuration to use for requests with this Recognizer. This can be overwritten by inline configuration in the RecognizeRequest.config field. |
↳ annotations |
array|Google\Protobuf\Internal\MapField
Allows users to store small amounts of arbitrary data. Both the key and the value must be 63 characters or less each. At most 100 annotations. |
↳ state |
int
Output only. The Recognizer lifecycle state. |
↳ create_time |
Google\Protobuf\Timestamp
Output only. Creation time. |
↳ update_time |
Google\Protobuf\Timestamp
Output only. The most recent time this Recognizer was modified. |
↳ delete_time |
Google\Protobuf\Timestamp
Output only. The time at which this Recognizer was requested for deletion. |
↳ expire_time |
Google\Protobuf\Timestamp
Output only. The time at which this Recognizer will be purged. |
↳ etag |
string
Output only. This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding. |
↳ reconciling |
bool
Output only. Whether or not this Recognizer is in the process of being updated. |
↳ kms_key_name |
string
Output only. The KMS key name with which the Recognizer is encrypted. The expected format is |
↳ kms_key_version_name |
string
Output only. The KMS key version name with which the Recognizer is encrypted. The expected format is |
getName
Output only. The resource name of the Recognizer.
Format: projects/{project}/locations/{location}/recognizers/{recognizer}
.
Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
string |
setName
Output only. The resource name of the Recognizer.
Format: projects/{project}/locations/{location}/recognizers/{recognizer}
.
Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getUid
Output only. System-assigned unique identifier for the Recognizer.
Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
string |
setUid
Output only. System-assigned unique identifier for the Recognizer.
Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDisplayName
User-settable, human-readable name for the Recognizer. Must be 63 characters or less.
Generated from protobuf field string display_name = 3;
Returns | |
---|---|
Type | Description |
string |
setDisplayName
User-settable, human-readable name for the Recognizer. Must be 63 characters or less.
Generated from protobuf field string display_name = 3;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getModel
Required. Which model to use for recognition requests. Select the model best suited to your domain to get best results.
Supported models:
latest_long
Best for long form content like media or conversation.latest_short
Best for short form content like commands or single shot directed speech. When using this model, the service will stop transcribing audio after the first utterance is detected and completed. When using this model, SEPARATE_RECOGNITION_PER_CHANNEL is not supported; multi-channel audio is accepted, but only the first channel will be processed and transcribed.
Generated from protobuf field string model = 4 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
string |
setModel
Required. Which model to use for recognition requests. Select the model best suited to your domain to get best results.
Supported models:
latest_long
Best for long form content like media or conversation.latest_short
Best for short form content like commands or single shot directed speech. When using this model, the service will stop transcribing audio after the first utterance is detected and completed. When using this model, SEPARATE_RECOGNITION_PER_CHANNEL is not supported; multi-channel audio is accepted, but only the first channel will be processed and transcribed.
Generated from protobuf field string model = 4 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getLanguageCodes
Required. The language of the supplied audio as a BCP-47 language tag.
Supported languages:
en-US
en-GB
fr-FR
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. When you create or update a Recognizer, these values are stored in normalized BCP-47 form. For example, "en-us" is stored as "en-US".
Generated from protobuf field repeated string language_codes = 17 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setLanguageCodes
Required. The language of the supplied audio as a BCP-47 language tag.
Supported languages:
en-US
en-GB
fr-FR
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. When you create or update a Recognizer, these values are stored in normalized BCP-47 form. For example, "en-us" is stored as "en-US".
Generated from protobuf field repeated string language_codes = 17 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getDefaultRecognitionConfig
Default configuration to use for requests with this Recognizer.
This can be overwritten by inline configuration in the RecognizeRequest.config field.
Generated from protobuf field .google.cloud.speech.v2.RecognitionConfig default_recognition_config = 6;
Returns | |
---|---|
Type | Description |
Google\Cloud\Speech\V2\RecognitionConfig|null |
hasDefaultRecognitionConfig
clearDefaultRecognitionConfig
setDefaultRecognitionConfig
Default configuration to use for requests with this Recognizer.
This can be overwritten by inline configuration in the RecognizeRequest.config field.
Generated from protobuf field .google.cloud.speech.v2.RecognitionConfig default_recognition_config = 6;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Speech\V2\RecognitionConfig
|
Returns | |
---|---|
Type | Description |
$this |
getAnnotations
Allows users to store small amounts of arbitrary data.
Both the key and the value must be 63 characters or less each. At most 100 annotations.
Generated from protobuf field map<string, string> annotations = 7;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\MapField |
setAnnotations
Allows users to store small amounts of arbitrary data.
Both the key and the value must be 63 characters or less each. At most 100 annotations.
Generated from protobuf field map<string, string> annotations = 7;
Parameter | |
---|---|
Name | Description |
var |
array|Google\Protobuf\Internal\MapField
|
Returns | |
---|---|
Type | Description |
$this |
getState
Output only. The Recognizer lifecycle state.
Generated from protobuf field .google.cloud.speech.v2.Recognizer.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
int |
setState
Output only. The Recognizer lifecycle state.
Generated from protobuf field .google.cloud.speech.v2.Recognizer.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getCreateTime
Output only. Creation time.
Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasCreateTime
clearCreateTime
setCreateTime
Output only. Creation time.
Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getUpdateTime
Output only. The most recent time this Recognizer was modified.
Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The most recent time this Recognizer was modified.
Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getDeleteTime
Output only. The time at which this Recognizer was requested for deletion.
Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasDeleteTime
clearDeleteTime
setDeleteTime
Output only. The time at which this Recognizer was requested for deletion.
Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getExpireTime
Output only. The time at which this Recognizer will be purged.
Generated from protobuf field .google.protobuf.Timestamp expire_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasExpireTime
clearExpireTime
setExpireTime
Output only. The time at which this Recognizer will be purged.
Generated from protobuf field .google.protobuf.Timestamp expire_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getEtag
Output only. This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
string |
setEtag
Output only. This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getReconciling
Output only. Whether or not this Recognizer is in the process of being updated.
Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
bool |
setReconciling
Output only. Whether or not this Recognizer is in the process of being updated.
Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getKmsKeyName
Output only. The KMS key
name with which
the Recognizer is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
.
Generated from protobuf field string kms_key_name = 15 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
Returns | |
---|---|
Type | Description |
string |
setKmsKeyName
Output only. The KMS key
name with which
the Recognizer is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
.
Generated from protobuf field string kms_key_name = 15 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getKmsKeyVersionName
Output only. The KMS key version
name
with which the Recognizer is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
.
Generated from protobuf field string kms_key_version_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
Returns | |
---|---|
Type | Description |
string |
setKmsKeyVersionName
Output only. The KMS key version
name
with which the Recognizer is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
.
Generated from protobuf field string kms_key_version_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |