Cloud Speech V2 Client - Class ExplicitDecodingConfig (1.7.0)

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ encoding int

Required. Encoding of the audio data sent for recognition.

↳ sample_rate_hertz int

Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000. 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 re-sampling). Supported for the following encodings: * LINEAR16: Headerless 16-bit signed little-endian PCM samples. * MULAW: Headerless 8-bit companded mulaw samples. * ALAW: Headerless 8-bit companded alaw samples.

↳ audio_channel_count int

Number of channels present in the audio data sent for recognition. Supported for the following encodings: * LINEAR16: Headerless 16-bit signed little-endian PCM samples. * MULAW: Headerless 8-bit companded mulaw samples. * ALAW: Headerless 8-bit companded alaw samples.

getEncoding

Required. Encoding of the audio data sent for recognition.

Generated from protobuf field .google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

setEncoding

Required. Encoding of the audio data sent for recognition.

Generated from protobuf field .google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getSampleRateHertz

Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000. 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 re-sampling).

Supported for the following encodings:

  • LINEAR16: Headerless 16-bit signed little-endian PCM samples.
  • MULAW: Headerless 8-bit companded mulaw samples.
  • ALAW: Headerless 8-bit companded alaw samples.

Generated from protobuf field int32 sample_rate_hertz = 2;

Returns
TypeDescription
int

setSampleRateHertz

Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000. 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 re-sampling).

Supported for the following encodings:

  • LINEAR16: Headerless 16-bit signed little-endian PCM samples.
  • MULAW: Headerless 8-bit companded mulaw samples.
  • ALAW: Headerless 8-bit companded alaw samples.

Generated from protobuf field int32 sample_rate_hertz = 2;

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getAudioChannelCount

Number of channels present in the audio data sent for recognition.

Supported for the following encodings:

  • LINEAR16: Headerless 16-bit signed little-endian PCM samples.
  • MULAW: Headerless 8-bit companded mulaw samples.
  • ALAW: Headerless 8-bit companded alaw samples.

Generated from protobuf field int32 audio_channel_count = 3;

Returns
TypeDescription
int

setAudioChannelCount

Number of channels present in the audio data sent for recognition.

Supported for the following encodings:

  • LINEAR16: Headerless 16-bit signed little-endian PCM samples.
  • MULAW: Headerless 8-bit companded mulaw samples.
  • ALAW: Headerless 8-bit companded alaw samples.

Generated from protobuf field int32 audio_channel_count = 3;

Parameter
NameDescription
var int
Returns
TypeDescription
$this