Reference documentation and code samples for the Cloud Speech V2 Client class ExplicitDecodingConfig.
Explicitly specified decoding parameters.
Generated from protobuf message google.cloud.speech.v2.ExplicitDecodingConfig
Namespace
Google \ Cloud \ Speech \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ encoding
int
Required. Encoding of the audio data sent for recognition.
↳ sample_rate_hertz
int
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.
↳ audio_channel_count
int
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.
getEncoding
Required. Encoding of the audio data sent for recognition.
Returns
Type
Description
int
setEncoding
Required. Encoding of the audio data sent for recognition.
Parameter
Name
Description
var
int
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, 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.
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, 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.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getAudioChannelCount
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.
Returns
Type
Description
int
setAudioChannelCount
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Speech V2 Client - Class ExplicitDecodingConfig (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig)\n- [2.1.0](/php/docs/reference/cloud-speech/2.1.0/V2.ExplicitDecodingConfig)\n- [2.0.1](/php/docs/reference/cloud-speech/2.0.1/V2.ExplicitDecodingConfig)\n- [1.20.1](/php/docs/reference/cloud-speech/1.20.1/V2.ExplicitDecodingConfig)\n- [1.19.2](/php/docs/reference/cloud-speech/1.19.2/V2.ExplicitDecodingConfig)\n- [1.18.3](/php/docs/reference/cloud-speech/1.18.3/V2.ExplicitDecodingConfig)\n- [1.16.0](/php/docs/reference/cloud-speech/1.16.0/V2.ExplicitDecodingConfig)\n- [1.15.0](/php/docs/reference/cloud-speech/1.15.0/V2.ExplicitDecodingConfig)\n- [1.14.3](/php/docs/reference/cloud-speech/1.14.3/V2.ExplicitDecodingConfig)\n- [1.13.1](/php/docs/reference/cloud-speech/1.13.1/V2.ExplicitDecodingConfig)\n- [1.12.0](/php/docs/reference/cloud-speech/1.12.0/V2.ExplicitDecodingConfig)\n- [1.11.2](/php/docs/reference/cloud-speech/1.11.2/V2.ExplicitDecodingConfig)\n- [1.10.0](/php/docs/reference/cloud-speech/1.10.0/V2.ExplicitDecodingConfig)\n- [1.9.1](/php/docs/reference/cloud-speech/1.9.1/V2.ExplicitDecodingConfig)\n- [1.8.0](/php/docs/reference/cloud-speech/1.8.0/V2.ExplicitDecodingConfig)\n- [1.7.0](/php/docs/reference/cloud-speech/1.7.0/V2.ExplicitDecodingConfig) \nReference documentation and code samples for the Cloud Speech V2 Client class ExplicitDecodingConfig.\n\nExplicitly specified decoding parameters.\n\nGenerated from protobuf message `google.cloud.speech.v2.ExplicitDecodingConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Speech \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getEncoding\n\nRequired. Encoding of the audio data sent for recognition.\n\n### setEncoding\n\nRequired. Encoding of the audio data sent for recognition.\n\n### getSampleRateHertz\n\nOptional. Sample rate in Hertz of the audio data sent for recognition.\n\nValid values are: 8000-48000, and 16000 is optimal. For best results, set\nthe sampling rate of the audio source to 16000 Hz. If that's not possible,\nuse the native sample rate of the audio source (instead of resampling).\nNote that this field is marked as OPTIONAL for backward compatibility\nreasons. It is (and has always been) effectively REQUIRED.\n\n### setSampleRateHertz\n\nOptional. Sample rate in Hertz of the audio data sent for recognition.\n\nValid values are: 8000-48000, and 16000 is optimal. For best results, set\nthe sampling rate of the audio source to 16000 Hz. If that's not possible,\nuse the native sample rate of the audio source (instead of resampling).\nNote that this field is marked as OPTIONAL for backward compatibility\nreasons. It is (and has always been) effectively REQUIRED.\n\n### getAudioChannelCount\n\nOptional. Number of channels present in the audio data sent for\nrecognition. Note that this field is marked as OPTIONAL for backward\ncompatibility reasons. It is (and has always been) effectively REQUIRED.\n\nThe maximum allowed value is 8.\n\n### setAudioChannelCount\n\nOptional. Number of channels present in the audio data sent for\nrecognition. Note that this field is marked as OPTIONAL for backward\ncompatibility reasons. It is (and has always been) effectively REQUIRED.\n\nThe maximum allowed value is 8."]]