- Resource: Recognizer
- RecognitionConfig
- AutoDetectDecodingConfig
- ExplicitDecodingConfig
- AudioEncoding
- RecognitionFeatures
- MultiChannelMode
- SpeakerDiarizationConfig
- SpeechAdaptation
- AdaptationPhraseSet
- TranscriptNormalization
- Entry
- TranslationConfig
- DenoiserConfig
- State
- Methods
Resource: Recognizer
A Recognizer message. Stores recognition configuration and metadata.
| JSON representation |
|---|
{ "name": string, "uid": string, "displayName": string, "model": string, "languageCodes": [ string ], "defaultRecognitionConfig": { object ( |
| Fields | |
|---|---|
name |
Output only. Identifier. The resource name of the Recognizer. Format: |
uid |
Output only. System-assigned unique identifier for the Recognizer. |
displayName |
User-settable, human-readable name for the Recognizer. Must be 63 characters or less. |
model |
Optional. This field is now deprecated. Prefer the 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. |
languageCodes[] |
Optional. This field is now deprecated. Prefer the The language of the supplied audio as a BCP-47 language tag. 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. 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". |
defaultRecognitionConfig |
Default configuration to use for requests with this Recognizer. This can be overwritten by inline configuration in the |
annotations |
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. An object containing a list of |
state |
Output only. The Recognizer lifecycle state. |
createTime |
Output only. Creation time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
updateTime |
Output only. The most recent time this Recognizer was modified. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
deleteTime |
Output only. The time at which this Recognizer was requested for deletion. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
expireTime |
Output only. The time at which this Recognizer will be purged. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
etag |
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 |
Output only. Whether or not this Recognizer is in the process of being updated. |
kmsKeyName |
Output only. The KMS key name with which the Recognizer is encrypted. The expected format is |
kmsKeyVersionName |
Output only. The KMS key version name with which the Recognizer is encrypted. The expected format is |
RecognitionConfig
Provides information to the Recognizer that specifies how to process the recognition request.
| JSON representation |
|---|
{ "model": string, "languageCodes": [ string ], "features": { object ( |
| Fields | |
|---|---|
model |
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. |
languageCodes[] |
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 |
Speech recognition features to enable. |
adaptation |
Speech adaptation context that weights recognizer predictions for specific words and phrases. |
transcriptNormalization |
Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts. |
translationConfig |
Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models. |
denoiserConfig |
Optional. Optional denoiser config. May not be supported for all models and may have no effect. |
Union field decoding_config. Decoding parameters for audio being sent for recognition. decoding_config can be only one of the following: |
|
autoDecodingConfig |
Automatically detect decoding parameters. Preferred for supported formats. |
explicitDecodingConfig |
Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw). |
AutoDetectDecodingConfig
This type has no fields.
Automatically detected decoding parameters. Supported for the following encodings:
WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
WAV_ALAW: 8-bit companded alaw samples in a WAV container.
RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
FLAC: FLAC frames in the "native FLAC" container format.
MP3: MPEG audio frames with optional (ignored) ID3 metadata.
OGG_OPUS: Opus audio frames in an Ogg container.
WEBM_OPUS: Opus audio frames in a WebM container.
MP4_AAC: AAC audio frames in an MP4 container.
M4A_AAC: AAC audio frames in an M4A container.
MOV_AAC: AAC audio frames in an MOV container.
ExplicitDecodingConfig
Explicitly specified decoding parameters.
| JSON representation |
|---|
{
"encoding": enum ( |
| Fields | |
|---|---|
encoding |
Required. Encoding of the audio data sent for recognition. |
sampleRateHertz |
Optional. Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000, and 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 resampling). Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. |
audioChannelCount |
Optional. Number of channels present in the audio data sent for recognition. Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. The maximum allowed value is 8. |
AudioEncoding
Supported audio data encodings.
| Enums | |
|---|---|
AUDIO_ENCODING_UNSPECIFIED |
Default value. This value is unused. |
LINEAR16 |
Headerless 16-bit signed little-endian PCM samples. |
MULAW |
Headerless 8-bit companded mulaw samples. |
ALAW |
Headerless 8-bit companded alaw samples. |
AMR |
AMR frames with an rfc4867.5 header. |
AMR_WB |
AMR-WB frames with an rfc4867.5 header. |
FLAC |
FLAC frames in the "native FLAC" container format. |
MP3 |
MPEG audio frames with optional (ignored) ID3 metadata. |
OGG_OPUS |
Opus audio frames in an Ogg container. |
WEBM_OPUS |
Opus audio frames in a WebM container. |
MP4_AAC |
AAC audio frames in an MP4 container. |
M4A_AAC |
AAC audio frames in an M4A container. |
MOV_AAC |
AAC audio frames in an MOV container. |
RecognitionFeatures
Available recognition features.
| JSON representation |
|---|
{ "profanityFilter": boolean, "enableWordTimeOffsets": boolean, "enableWordConfidence": boolean, "enableAutomaticPunctuation": boolean, "enableSpokenPunctuation": boolean, "enableSpokenEmojis": boolean, "multiChannelMode": enum ( |
| Fields | |
|---|---|
profanityFilter |
If set to |
enableWordTimeOffsets |
If |
enableWordConfidence |
If |
enableAutomaticPunctuation |
If |
enableSpokenPunctuation |
The spoken punctuation behavior for the call. If |
enableSpokenEmojis |
The spoken emoji behavior for the call. If |
multiChannelMode |
Mode for recognizing multi-channel audio. |
diarizationConfig |
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message. |
maxAlternatives |
Maximum number of recognition hypotheses to be returned. The server may return fewer than |
MultiChannelMode
Options for how to recognize multi-channel audio.
| Enums | |
|---|---|
MULTI_CHANNEL_MODE_UNSPECIFIED |
Default value for the multi-channel mode. If the audio contains multiple channels, only the first channel will be transcribed; other channels will be ignored. |
SEPARATE_RECOGNITION_PER_CHANNEL |
If selected, each channel in the provided audio is transcribed independently. This cannot be selected if the selected model is latest_short. |
SpeakerDiarizationConfig
Configuration to enable speaker diarization.
| JSON representation |
|---|
{ "minSpeakerCount": integer, "maxSpeakerCount": integer } |
| Fields | |
|---|---|
minSpeakerCount |
Optional. The system automatically determines the number of speakers. This value is not currently used. |
maxSpeakerCount |
Optional. The system automatically determines the number of speakers. This value is not currently used. |
SpeechAdaptation
Provides "hints" to the speech recognizer to favor specific words and phrases in the results. PhraseSets can be specified as an inline resource, or a reference to an existing PhraseSet resource.
| JSON representation |
|---|
{ "phraseSets": [ { object ( |
| Fields | |
|---|---|
phraseSets[] |
A list of inline or referenced PhraseSets. |
customClasses[] |
A list of inline CustomClasses. Existing CustomClass resources can be referenced directly in a PhraseSet. |
AdaptationPhraseSet
A biasing PhraseSet, which can be either a string referencing the name of an existing PhraseSets resource, or an inline definition of a PhraseSet.
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
phraseSet |
The name of an existing PhraseSet resource. The user must have read access to the resource and it must not be deleted. |
inlinePhraseSet |
An inline defined PhraseSet. |
TranscriptNormalization
Transcription normalization configuration. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts.
| JSON representation |
|---|
{
"entries": [
{
object ( |
| Fields | |
|---|---|
entries[] |
A list of replacement entries. We will perform replacement with one entry at a time. For example, the second entry in ["cat" => "dog", "mountain cat" => "mountain dog"] will never be applied because we will always process the first entry before it. At most 100 entries. |
Entry
A single replacement configuration.
| JSON representation |
|---|
{ "search": string, "replace": string, "caseSensitive": boolean } |
| Fields | |
|---|---|
search |
What to replace. Max length is 100 characters. |
replace |
What to replace with. Max length is 100 characters. |
caseSensitive |
Whether the search is case sensitive. |
TranslationConfig
Translation configuration. Use to translate the given audio into text for the desired language.
| JSON representation |
|---|
{ "targetLanguage": string } |
| Fields | |
|---|---|
targetLanguage |
Required. The language code to translate to. |
DenoiserConfig
Denoiser config. May not be supported for all models and may have no effect.
| JSON representation |
|---|
{ "denoiseAudio": boolean, "snrThreshold": number } |
| Fields | |
|---|---|
denoiseAudio |
Denoise audio before sending to the transcription model. |
snrThreshold |
Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the loudness of the speech signal. Audio with an SNR below this threshold, meaning the speech is too quiet, will be prevented from being sent to the transcription model. If snrThreshold=0, no filtering will be applied. |
State
Set of states that define the lifecycle of a Recognizer.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The default value. This value is used if the state is omitted. |
ACTIVE |
The Recognizer is active and ready for use. |
DELETED |
This Recognizer has been deleted. |
Methods |
|
|---|---|
|
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished. |
|
Creates a Recognizer. |
|
Deletes the Recognizer. |
|
Returns the requested Recognizer. |
|
Lists Recognizers. |
|
Updates the Recognizer. |
|
Performs synchronous Speech recognition: receive results after all audio has been sent and processed. |
|
Undeletes the Recognizer. |