google.cloud.dialogflow.v2.InputAudioConfig
*/
class InputAudioConfig extends \Google\Protobuf\Internal\Message
{
/**
* Required. Audio encoding of the audio content to process.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1;
*/
private $audio_encoding = 0;
/**
* Required. Sample rate (in Hertz) of the audio content sent in the query.
* Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
* details.
*
* Generated from protobuf field int32 sample_rate_hertz = 2;
*/
private $sample_rate_hertz = 0;
/**
* Required. The language of the supplied audio. Dialogflow does not do
* translations. See [Language
* Support](https://dialogflow.com/docs/languages) for a list of the
* currently supported language codes. Note that queries in the same session
* do not necessarily need to specify the same language.
*
* Generated from protobuf field string language_code = 3;
*/
private $language_code = '';
/**
* Optional. The collection of phrase hints which are used to boost accuracy
* of speech recognition.
* Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
* for more details.
*
* Generated from protobuf field repeated string phrase_hints = 4;
*/
private $phrase_hints;
public function __construct() {
\GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce();
parent::__construct();
}
/**
* Required. Audio encoding of the audio content to process.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1;
* @return int
*/
public function getAudioEncoding()
{
return $this->audio_encoding;
}
/**
* Required. Audio encoding of the audio content to process.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1;
* @param int $var
* @return $this
*/
public function setAudioEncoding($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class);
$this->audio_encoding = $var;
return $this;
}
/**
* Required. Sample rate (in Hertz) of the audio content sent in the query.
* Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
* details.
*
* Generated from protobuf field int32 sample_rate_hertz = 2;
* @return int
*/
public function getSampleRateHertz()
{
return $this->sample_rate_hertz;
}
/**
* Required. Sample rate (in Hertz) of the audio content sent in the query.
* Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
* details.
*
* Generated from protobuf field int32 sample_rate_hertz = 2;
* @param int $var
* @return $this
*/
public function setSampleRateHertz($var)
{
GPBUtil::checkInt32($var);
$this->sample_rate_hertz = $var;
return $this;
}
/**
* Required. The language of the supplied audio. Dialogflow does not do
* translations. See [Language
* Support](https://dialogflow.com/docs/languages) for a list of the
* currently supported language codes. Note that queries in the same session
* do not necessarily need to specify the same language.
*
* Generated from protobuf field string language_code = 3;
* @return string
*/
public function getLanguageCode()
{
return $this->language_code;
}
/**
* Required. The language of the supplied audio. Dialogflow does not do
* translations. See [Language
* Support](https://dialogflow.com/docs/languages) for a list of the
* currently supported language codes. Note that queries in the same session
* do not necessarily need to specify the same language.
*
* Generated from protobuf field string language_code = 3;
* @param string $var
* @return $this
*/
public function setLanguageCode($var)
{
GPBUtil::checkString($var, True);
$this->language_code = $var;
return $this;
}
/**
* Optional. The collection of phrase hints which are used to boost accuracy
* of speech recognition.
* Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
* for more details.
*
* Generated from protobuf field repeated string phrase_hints = 4;
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getPhraseHints()
{
return $this->phrase_hints;
}
/**
* Optional. The collection of phrase hints which are used to boost accuracy
* of speech recognition.
* Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
* for more details.
*
* Generated from protobuf field repeated string phrase_hints = 4;
* @param string[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setPhraseHints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->phrase_hints = $arr;
return $this;
}
}