From fe6de61ff6876a1aa99fb6093bf8efd0bd5a232c Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 8 Jan 2025 22:56:47 +0000 Subject: [PATCH] add missing StreamingSynthesizeConfig --- TextToSpeech/src/V1/StreamingAudioConfig.php | 109 +++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 TextToSpeech/src/V1/StreamingAudioConfig.php diff --git a/TextToSpeech/src/V1/StreamingAudioConfig.php b/TextToSpeech/src/V1/StreamingAudioConfig.php new file mode 100644 index 00000000000..439bd093703 --- /dev/null +++ b/TextToSpeech/src/V1/StreamingAudioConfig.php @@ -0,0 +1,109 @@ +google.cloud.texttospeech.v1.StreamingAudioConfig + */ +class StreamingAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * For now, streaming only supports PCM and OGG_OPUS. All other encodings + * will return an error. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * For now, streaming only supports PCM and OGG_OPUS. All other encodings + * will return an error. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * For now, streaming only supports PCM and OGG_OPUS. All other encodings + * will return an error. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. The format of the audio byte stream. + * For now, streaming only supports PCM and OGG_OPUS. All other encodings + * will return an error. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + +} +