<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/speech/v2/cloud_speech.proto

namespace Google\Cloud\Speech\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Explicitly specified decoding parameters.
 *
 * Generated from protobuf message <code>google.cloud.speech.v2.ExplicitDecodingConfig</code>
 */
class ExplicitDecodingConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Encoding of the audio data sent for recognition.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding encoding = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $encoding = 0;
    /**
     * 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 <code>int32 sample_rate_hertz = 2;</code>
     */
    private $sample_rate_hertz = 0;
    /**
     * 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 <code>int32 audio_channel_count = 3;</code>
     */
    private $audio_channel_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $encoding
     *           Required. Encoding of the audio data sent for recognition.
     *     @type int $sample_rate_hertz
     *           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.
     *     @type int $audio_channel_count
     *           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.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V2\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Encoding of the audio data sent for recognition.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding encoding = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getEncoding()
    {
        return $this->encoding;
    }

    /**
     * Required. Encoding of the audio data sent for recognition.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding encoding = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setEncoding($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Speech\V2\ExplicitDecodingConfig\AudioEncoding::class);
        $this->encoding = $var;

        return $this;
    }

    /**
     * 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 <code>int32 sample_rate_hertz = 2;</code>
     * @return int
     */
    public function getSampleRateHertz()
    {
        return $this->sample_rate_hertz;
    }

    /**
     * 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 <code>int32 sample_rate_hertz = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSampleRateHertz($var)
    {
        GPBUtil::checkInt32($var);
        $this->sample_rate_hertz = $var;

        return $this;
    }

    /**
     * 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 <code>int32 audio_channel_count = 3;</code>
     * @return int
     */
    public function getAudioChannelCount()
    {
        return $this->audio_channel_count;
    }

    /**
     * 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 <code>int32 audio_channel_count = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setAudioChannelCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->audio_channel_count = $var;

        return $this;
    }

}

