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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents the natural language speech audio to be processed.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.AudioInput</code>
 */
class AudioInput extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Instructs the speech recognizer how to process the speech audio.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $config = null;
    /**
     * Required. The natural language speech audio to be processed.
     * A single request can contain up to 2 minutes of speech audio data.
     * The transcribed text cannot contain more than 256 bytes for virtual agent
     * interactions.
     *
     * Generated from protobuf field <code>bytes audio = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $audio = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $config
     *           Required. Instructs the speech recognizer how to process the speech audio.
     *     @type string $audio
     *           Required. The natural language speech audio to be processed.
     *           A single request can contain up to 2 minutes of speech audio data.
     *           The transcribed text cannot contain more than 256 bytes for virtual agent
     *           interactions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Instructs the speech recognizer how to process the speech audio.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null
     */
    public function getConfig()
    {
        return $this->config;
    }

    public function hasConfig()
    {
        return isset($this->config);
    }

    public function clearConfig()
    {
        unset($this->config);
    }

    /**
     * Required. Instructs the speech recognizer how to process the speech audio.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var
     * @return $this
     */
    public function setConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class);
        $this->config = $var;

        return $this;
    }

    /**
     * Required. The natural language speech audio to be processed.
     * A single request can contain up to 2 minutes of speech audio data.
     * The transcribed text cannot contain more than 256 bytes for virtual agent
     * interactions.
     *
     * Generated from protobuf field <code>bytes audio = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getAudio()
    {
        return $this->audio;
    }

    /**
     * Required. The natural language speech audio to be processed.
     * A single request can contain up to 2 minutes of speech audio data.
     * The transcribed text cannot contain more than 256 bytes for virtual agent
     * interactions.
     *
     * Generated from protobuf field <code>bytes audio = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setAudio($var)
    {
        GPBUtil::checkString($var, False);
        $this->audio = $var;

        return $this;
    }

}

