Cloud Speech V2 Client - Class ExplicitDecodingConfig (2.3.0) Stay organized with collections Save and categorize content based on your preferences.
Reference documentation and code samples for the Cloud Speech V2 Client class ExplicitDecodingConfig.
Explicitly specified decoding parameters.
Generated from protobuf messagegoogle.cloud.speech.v2.ExplicitDecodingConfig
Namespace
Google \ Cloud \ Speech \ V2Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data | arrayOptional. Data for populating the Message object. |
↳ encoding | intRequired. Encoding of the audio data sent for recognition. |
↳ sample_rate_hertz | intOptional. 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. |
↳ audio_channel_count | intOptional. 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. |
getEncoding
Required. Encoding of the audio data sent for recognition.
| Returns | |
|---|---|
| Type | Description |
int | Enum of typeAudioEncoding. |
setEncoding
Required. Encoding of the audio data sent for recognition.
| Parameter | |
|---|---|
| Name | Description |
var | intEnum of typeAudioEncoding. |
| Returns | |
|---|---|
| Type | Description |
$this | |
getSampleRateHertz
Optional. Sample rate in Hertz of the audio data sent for recognition.
Valid values are: 8000-48000, and 16000 is optimal. For best results, setthe 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 compatibilityreasons. It is (and has always been) effectively REQUIRED.
| Returns | |
|---|---|
| Type | Description |
int | |
setSampleRateHertz
Optional. Sample rate in Hertz of the audio data sent for recognition.
Valid values are: 8000-48000, and 16000 is optimal. For best results, setthe 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 compatibilityreasons. It is (and has always been) effectively REQUIRED.
| Parameter | |
|---|---|
| Name | Description |
var | int |
| Returns | |
|---|---|
| Type | Description |
$this | |
getAudioChannelCount
Optional. Number of channels present in the audio data sent forrecognition. Note that this field is marked as OPTIONAL for backwardcompatibility reasons. It is (and has always been) effectively REQUIRED.
The maximum allowed value is 8.
| Returns | |
|---|---|
| Type | Description |
int | |
setAudioChannelCount
Optional. Number of channels present in the audio data sent forrecognition. Note that this field is marked as OPTIONAL for backwardcompatibility reasons. It is (and has always been) effectively REQUIRED.
The maximum allowed value is 8.
| Parameter | |
|---|---|
| Name | Description |
var | int |
| Returns | |
|---|---|
| Type | Description |
$this | |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-23 UTC.