From 92e5e5ffa417d23c298f31501beb764178de9ad2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 31 Mar 2026 22:33:11 +0000 Subject: [PATCH 1/6] feat: Support safety settings for Gemini voices and deprecate `relax_safety_filters` feat: Support `enable_textnorm` for Gemini voices. feat: Mark `advanced_voice_options` as optional. docs: A comment for field `relax_safety_filters` in message `.google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions` is changed docs: A comment for field `advanced_voice_options` in message `.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.SynthesisInput` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.StreamingSynthesisInput` is changed PiperOrigin-RevId: 892460024 Source-Link: https://github.com/googleapis/googleapis/commit/015ab812ade8d13cc78cbdf195e7a6e4499f0157 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5af795eed18ccb69c161b6772886dbcbc8f28e19 Copy-Tag: eyJwIjoiVGV4dFRvU3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiI1YWY3OTVlZWQxOGNjYjY5YzE2MWI2NzcyODg2ZGJjYmM4ZjI4ZTE5In0= --- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 ++ .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 ++ .../TextToSpeech/V1/AdvancedVoiceOptions.php | 230 ++++++++++ .../HarmBlockThreshold.php | 82 ++++ .../V1/AdvancedVoiceOptions/HarmCategory.php | 76 ++++ .../V1/AdvancedVoiceOptions/SafetySetting.php | 101 +++++ .../AdvancedVoiceOptions/SafetySettings.php | 67 +++ .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 +++++++++++++++ .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 +++++ .../V1/CustomPronunciationParams.php | 177 ++++++++ .../PhoneticEncoding.php | 90 ++++ .../TextToSpeech/V1/CustomPronunciations.php | 67 +++ .../TextToSpeech/V1/CustomVoiceParams.php | 108 +++++ .../V1/CustomVoiceParams/ReportedUsage.php | 65 +++ .../TextToSpeech/V1/ListVoicesRequest.php | 115 +++++ .../TextToSpeech/V1/ListVoicesResponse.php | 67 +++ .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 +++ .../V1/MultiSpeakerMarkup/Turn.php | 105 +++++ .../V1/MultiSpeakerVoiceConfig.php | 72 ++++ .../V1/MultispeakerPrebuiltVoice.php | 114 +++++ .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ++++ .../TextToSpeech/V1/StreamingAudioConfig.php | 155 +++++++ .../V1/StreamingSynthesisInput.php | 197 +++++++++ .../V1/StreamingSynthesizeConfig.php | 237 +++++++++++ .../V1/StreamingSynthesizeRequest.php | 118 ++++++ .../V1/StreamingSynthesizeResponse.php | 73 ++++ .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 ++++++++++++++ .../V1/SynthesizeLongAudioMetadata.php | 166 ++++++++ .../V1/SynthesizeLongAudioRequest.php | 246 +++++++++++ .../V1/SynthesizeLongAudioResponse.php | 33 ++ .../V1/SynthesizeSpeechRequest.php | 226 ++++++++++ .../V1/SynthesizeSpeechResponse.php | 83 ++++ .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 ++++++++ .../TextToSpeech/V1/VoiceCloneParams.php | 67 +++ .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ++++++++++++++++++ .../V1/TextToSpeechClient/list_voices.php | 57 +++ .../streaming_synthesize.php | 64 +++ .../TextToSpeechClient/synthesize_speech.php | 94 +++++ .../synthesize_long_audio.php | 89 ++++ .../v1/src/V1/Client/TextToSpeechClient.php | 308 ++++++++++++++ .../TextToSpeechLongAudioSynthesizeClient.php | 310 ++++++++++++++ .../v1/src/V1/gapic_metadata.json | 47 +++ .../text_to_speech_client_config.json | 58 +++ .../text_to_speech_descriptor_config.php | 46 ++ ...h_long_audio_synthesize_client_config.json | 37 ++ ...ong_audio_synthesize_descriptor_config.php | 50 +++ ...ng_audio_synthesize_rest_client_config.php | 65 +++ .../text_to_speech_rest_client_config.php | 62 +++ .../Unit/V1/Client/TextToSpeechClientTest.php | 325 +++++++++++++++ ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ++++++++++++ 50 files changed, 6546 insertions(+) create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php new file mode 100644 index 000000000000..09089fee21c9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php new file mode 100644 index 000000000000..78b5cfdb66d4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php new file mode 100644 index 000000000000..d30dc7f08739 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php @@ -0,0 +1,230 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions + */ +class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + */ + protected $low_latency_journey_synthesis = null; + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $relax_safety_filters = false; + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $safety_settings = null; + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_textnorm = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $low_latency_journey_synthesis + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * @type bool $relax_safety_filters + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * @type bool $enable_textnorm + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @return bool + */ + public function getLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; + } + + public function hasLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis); + } + + public function clearLowLatencyJourneySynthesis() + { + unset($this->low_latency_journey_synthesis); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @param bool $var + * @return $this + */ + public function setLowLatencyJourneySynthesis($var) + { + GPBUtil::checkBool($var); + $this->low_latency_journey_synthesis = $var; + + return $this; + } + + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getRelaxSafetyFilters() + { + if ($this->relax_safety_filters !== false) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + } + return $this->relax_safety_filters; + } + + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setRelaxSafetyFilters($var) + { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->relax_safety_filters = $var; + + return $this; + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null + */ + public function getSafetySettings() + { + return $this->safety_settings; + } + + public function hasSafetySettings() + { + return isset($this->safety_settings); + } + + public function clearSafetySettings() + { + unset($this->safety_settings); + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var + * @return $this + */ + public function setSafetySettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); + $this->safety_settings = $var; + + return $this; + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextnorm() + { + return isset($this->enable_textnorm) ? $this->enable_textnorm : false; + } + + public function hasEnableTextnorm() + { + return isset($this->enable_textnorm); + } + + public function clearEnableTextnorm() + { + unset($this->enable_textnorm); + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextnorm($var) + { + GPBUtil::checkBool($var); + $this->enable_textnorm = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php new file mode 100644 index 000000000000..c2c2a32aae59 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php @@ -0,0 +1,82 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold + */ +class HarmBlockThreshold +{ + /** + * The harm block threshold is unspecified. + * + * Generated from protobuf enum HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + */ + const HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + /** + * Block content with a low harm probability or higher. + * + * Generated from protobuf enum BLOCK_LOW_AND_ABOVE = 1; + */ + const BLOCK_LOW_AND_ABOVE = 1; + /** + * Block content with a medium harm probability or higher. + * + * Generated from protobuf enum BLOCK_MEDIUM_AND_ABOVE = 2; + */ + const BLOCK_MEDIUM_AND_ABOVE = 2; + /** + * Block content with a high harm probability. + * + * Generated from protobuf enum BLOCK_ONLY_HIGH = 3; + */ + const BLOCK_ONLY_HIGH = 3; + /** + * Do not block any content, regardless of its harm probability. + * + * Generated from protobuf enum BLOCK_NONE = 4; + */ + const BLOCK_NONE = 4; + /** + * Turn off the safety filter entirely. + * + * Generated from protobuf enum OFF = 5; + */ + const OFF = 5; + + private static $valueToName = [ + self::HARM_BLOCK_THRESHOLD_UNSPECIFIED => 'HARM_BLOCK_THRESHOLD_UNSPECIFIED', + self::BLOCK_LOW_AND_ABOVE => 'BLOCK_LOW_AND_ABOVE', + self::BLOCK_MEDIUM_AND_ABOVE => 'BLOCK_MEDIUM_AND_ABOVE', + self::BLOCK_ONLY_HIGH => 'BLOCK_ONLY_HIGH', + self::BLOCK_NONE => 'BLOCK_NONE', + self::OFF => 'OFF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php new file mode 100644 index 000000000000..cf4329b14f5e --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php @@ -0,0 +1,76 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory + */ +class HarmCategory +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum HARM_CATEGORY_UNSPECIFIED = 0; + */ + const HARM_CATEGORY_UNSPECIFIED = 0; + /** + * Content that promotes violence or incites hatred against individuals or + * groups based on certain attributes. + * + * Generated from protobuf enum HARM_CATEGORY_HATE_SPEECH = 1; + */ + const HARM_CATEGORY_HATE_SPEECH = 1; + /** + * Content that promotes, facilitates, or enables dangerous activities. + * + * Generated from protobuf enum HARM_CATEGORY_DANGEROUS_CONTENT = 2; + */ + const HARM_CATEGORY_DANGEROUS_CONTENT = 2; + /** + * Abusive, threatening, or content intended to bully, torment, or ridicule. + * + * Generated from protobuf enum HARM_CATEGORY_HARASSMENT = 3; + */ + const HARM_CATEGORY_HARASSMENT = 3; + /** + * Content that contains sexually explicit material. + * + * Generated from protobuf enum HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + */ + const HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + + private static $valueToName = [ + self::HARM_CATEGORY_UNSPECIFIED => 'HARM_CATEGORY_UNSPECIFIED', + self::HARM_CATEGORY_HATE_SPEECH => 'HARM_CATEGORY_HATE_SPEECH', + self::HARM_CATEGORY_DANGEROUS_CONTENT => 'HARM_CATEGORY_DANGEROUS_CONTENT', + self::HARM_CATEGORY_HARASSMENT => 'HARM_CATEGORY_HARASSMENT', + self::HARM_CATEGORY_SEXUALLY_EXPLICIT => 'HARM_CATEGORY_SEXUALLY_EXPLICIT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php new file mode 100644 index 000000000000..7a43b6d3e35c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php @@ -0,0 +1,101 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting + */ +class SafetySetting extends \Google\Protobuf\Internal\Message +{ + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + */ + protected $category = 0; + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + */ + protected $threshold = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $category + * The harm category to apply the safety setting to. + * @type int $threshold + * The harm block threshold for the safety setting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmCategory::class); + $this->category = $var; + + return $this; + } + + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + * @return int + */ + public function getThreshold() + { + return $this->threshold; + } + + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + * @param int $var + * @return $this + */ + public function setThreshold($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmBlockThreshold::class); + $this->threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php new file mode 100644 index 000000000000..8fedf168ccfd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings + */ +class SafetySettings extends \Google\Protobuf\Internal\Message +{ + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + */ + private $settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $settings + * The safety settings for the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting> + */ + public function getSettings() + { + return $this->settings; + } + + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $var + * @return $this + */ + public function setSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting::class); + $this->settings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php new file mode 100644 index 000000000000..e490622773f8 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php @@ -0,0 +1,329 @@ +google.cloud.texttospeech.v1.AudioConfig + */ +class AudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * @type float $pitch + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * @type float $volume_gain_db + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * @type string[] $effects_profile_id + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * + * 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. + * + * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEffectsProfileId() + { + return $this->effects_profile_id; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEffectsProfileId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effects_profile_id = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php new file mode 100644 index 000000000000..f1840272c122 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php @@ -0,0 +1,107 @@ +google.cloud.texttospeech.v1.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return + * result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum LINEAR16 = 1; + */ + const LINEAR16 = 1; + /** + * MP3 audio at 32kbps. + * + * Generated from protobuf enum MP3 = 2; + */ + const MP3 = 2; + /** + * Opus encoded audio wrapped in an ogg container. The result is a + * file which can be played natively on Android, and in browsers (at least + * Chrome and Firefox). The quality of the encoding is considerably higher + * than MP3 while using approximately the same bitrate. + * + * Generated from protobuf enum OGG_OPUS = 3; + */ + const OGG_OPUS = 3; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * Audio content returned as MULAW also contains a WAV header. + * + * Generated from protobuf enum MULAW = 5; + */ + const MULAW = 5; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + * Audio content returned as ALAW also contains a WAV header. + * + * Generated from protobuf enum ALAW = 6; + */ + const ALAW = 6; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or + * any other) header. + * + * Generated from protobuf enum PCM = 7; + */ + const PCM = 7; + /** + * M4A audio. + * + * Generated from protobuf enum M4A = 8; + */ + const M4A = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::LINEAR16 => 'LINEAR16', + self::MP3 => 'MP3', + self::OGG_OPUS => 'OGG_OPUS', + self::MULAW => 'MULAW', + self::ALAW => 'ALAW', + self::PCM => 'PCM', + self::M4A => 'M4A', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php new file mode 100644 index 000000000000..2c5b30d8ee8c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams + */ +class CustomPronunciationParams extends \Google\Protobuf\Internal\Message +{ + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + */ + protected $phrase = null; + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + */ + protected $phonetic_encoding = null; + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + */ + protected $pronunciation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $phrase + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * @type int $phonetic_encoding + * The phonetic encoding of the phrase. + * @type string $pronunciation + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @return string + */ + public function getPhrase() + { + return isset($this->phrase) ? $this->phrase : ''; + } + + public function hasPhrase() + { + return isset($this->phrase); + } + + public function clearPhrase() + { + unset($this->phrase); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @param string $var + * @return $this + */ + public function setPhrase($var) + { + GPBUtil::checkString($var, True); + $this->phrase = $var; + + return $this; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @return int + */ + public function getPhoneticEncoding() + { + return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; + } + + public function hasPhoneticEncoding() + { + return isset($this->phonetic_encoding); + } + + public function clearPhoneticEncoding() + { + unset($this->phonetic_encoding); + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @param int $var + * @return $this + */ + public function setPhoneticEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); + $this->phonetic_encoding = $var; + + return $this; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @return string + */ + public function getPronunciation() + { + return isset($this->pronunciation) ? $this->pronunciation : ''; + } + + public function hasPronunciation() + { + return isset($this->pronunciation); + } + + public function clearPronunciation() + { + unset($this->pronunciation); + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @param string $var + * @return $this + */ + public function setPronunciation($var) + { + GPBUtil::checkString($var, True); + $this->pronunciation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php new file mode 100644 index 000000000000..c2402dce74e4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php @@ -0,0 +1,90 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding + */ +class PhoneticEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; + */ + const PHONETIC_ENCODING_UNSPECIFIED = 0; + /** + * IPA, such as apple -> ˈæpəl. + * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + * + * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; + */ + const PHONETIC_ENCODING_IPA = 1; + /** + * X-SAMPA, such as apple -> "{p\@l". + * https://en.wikipedia.org/wiki/X-SAMPA + * + * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; + */ + const PHONETIC_ENCODING_X_SAMPA = 2; + /** + * For reading-to-pron conversion to work well, the `pronunciation` field + * should only contain Kanji, Hiragana, and Katakana. + * The pronunciation can also contain pitch accents. + * The start of a pitch phrase is specified with `^` and the down-pitch + * position is specified with `!`, for example: + * phrase:端 pronunciation:^はし + * phrase:箸 pronunciation:^は!し + * phrase:橋 pronunciation:^はし! + * We currently only support the Tokyo dialect, which allows at most one + * down-pitch per phrase (i.e. at most one `!` between `^`). + * + * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + */ + const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + /** + * Used to specify pronunciations for Mandarin words. See + * https://en.wikipedia.org/wiki/Pinyin. + * For example: 朝阳, the pronunciation is "chao2 yang2". The number + * represents the tone, and there is a space between syllables. Neutral + * tones are represented by 5, for example 孩子 "hai2 zi5". + * + * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; + */ + const PHONETIC_ENCODING_PINYIN = 4; + + private static $valueToName = [ + self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', + self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', + self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', + self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', + self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php new file mode 100644 index 000000000000..624e775a9ee3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.CustomPronunciations + */ +class CustomPronunciations extends \Google\Protobuf\Internal\Message +{ + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + */ + private $pronunciations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations + * The pronunciation customizations are applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> + */ + public function getPronunciations() + { + return $this->pronunciations; + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var + * @return $this + */ + public function setPronunciations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); + $this->pronunciations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php new file mode 100644 index 000000000000..f84c66d01a3a --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php @@ -0,0 +1,108 @@ +google.cloud.texttospeech.v1.CustomVoiceParams + */ +class CustomVoiceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $model = ''; + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $reported_usage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Required. The name of the AutoML model that synthesizes the custom voice. + * @type int $reported_usage + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return int + * @deprecated + */ + public function getReportedUsage() + { + if ($this->reported_usage !== 0) { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + } + return $this->reported_usage; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + * @deprecated + */ + public function setReportedUsage($var) + { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); + $this->reported_usage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php new file mode 100644 index 000000000000..ecec1d4c0cc3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php @@ -0,0 +1,65 @@ +google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage + */ +class ReportedUsage +{ + /** + * Request with reported usage unspecified will be rejected. + * + * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; + */ + const REPORTED_USAGE_UNSPECIFIED = 0; + /** + * For scenarios where the synthesized audio is not downloadable and can + * only be used once. For example, real-time request in IVR system. + * + * Generated from protobuf enum REALTIME = 1; + */ + const REALTIME = 1; + /** + * For scenarios where the synthesized audio is downloadable and can be + * reused. For example, the synthesized audio is downloaded, stored in + * customer service system and played repeatedly. + * + * Generated from protobuf enum OFFLINE = 2; + */ + const OFFLINE = 2; + + private static $valueToName = [ + self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', + self::REALTIME => 'REALTIME', + self::OFFLINE => 'OFFLINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php new file mode 100644 index 000000000000..12a0e68e3f6b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php @@ -0,0 +1,115 @@ +google.cloud.texttospeech.v1.ListVoicesRequest + */ +class ListVoicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $languageCode Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest + * + * @experimental + */ + public static function build(string $languageCode): self + { + return (new self()) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php new file mode 100644 index 000000000000..fa9403399bd4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.ListVoicesResponse + */ +class ListVoicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + */ + private $voices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices + * The list of voices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> + */ + public function getVoices() + { + return $this->voices; + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var + * @return $this + */ + public function setVoices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); + $this->voices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php new file mode 100644 index 000000000000..f8f99a09a577 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup + */ +class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $turns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns + * Required. Speaker turns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> + */ + public function getTurns() + { + return $this->turns; + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var + * @return $this + */ + public function setTurns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); + $this->turns = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php new file mode 100644 index 000000000000..2a23ef66e117 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php @@ -0,0 +1,105 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + */ +class Turn extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker = ''; + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * @type string $text + * Required. The text to speak. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeaker() + { + return $this->speaker; + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeaker($var) + { + GPBUtil::checkString($var, True); + $this->speaker = $var; + + return $this; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php new file mode 100644 index 000000000000..8da52d2fb891 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php @@ -0,0 +1,72 @@ +google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig + */ +class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $speaker_voice_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> + */ + public function getSpeakerVoiceConfigs() + { + return $this->speaker_voice_configs; + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var + * @return $this + */ + public function setSpeakerVoiceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); + $this->speaker_voice_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php new file mode 100644 index 000000000000..3b6efea63337 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php @@ -0,0 +1,114 @@ +google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice + */ +class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_alias = ''; + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker_alias + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * @type string $speaker_id + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerAlias() + { + return $this->speaker_alias; + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerAlias($var) + { + GPBUtil::checkString($var, True); + $this->speaker_alias = $var; + + return $this; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerId() + { + return $this->speaker_id; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerId($var) + { + GPBUtil::checkString($var, True); + $this->speaker_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php new file mode 100644 index 000000000000..ca9b5bfd29a5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.SsmlVoiceGender + */ +class SsmlVoiceGender +{ + /** + * An unspecified gender. + * In VoiceSelectionParams, this means that the client doesn't care which + * gender the selected voice will have. In the Voice field of + * ListVoicesResponse, this may mean that the voice doesn't fit any of the + * other categories in this enum, or that the gender of the voice isn't known. + * + * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + const SSML_VOICE_GENDER_UNSPECIFIED = 0; + /** + * A male voice. + * + * Generated from protobuf enum MALE = 1; + */ + const MALE = 1; + /** + * A female voice. + * + * Generated from protobuf enum FEMALE = 2; + */ + const FEMALE = 2; + /** + * A gender-neutral voice. This voice is not yet supported. + * + * Generated from protobuf enum NEUTRAL = 3; + */ + const NEUTRAL = 3; + + private static $valueToName = [ + self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', + self::MALE => 'MALE', + self::FEMALE => 'FEMALE', + self::NEUTRAL => 'NEUTRAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php new file mode 100644 index 000000000000..95dfe75a3cbd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php @@ -0,0 +1,155 @@ +google.cloud.texttospeech.v1.StreamingAudioConfig + */ +class StreamingAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * return an error. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php new file mode 100644 index 000000000000..49624284bec9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php @@ -0,0 +1,197 @@ +google.cloud.texttospeech.v1.StreamingSynthesisInput + */ +class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * @type string $markup + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * @type string $prompt + * This is system instruction supported only for controllable voice models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(7); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(7); + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php new file mode 100644 index 000000000000..d81c076523d6 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php @@ -0,0 +1,237 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeConfig + */ +class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $streaming_audio_config = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config + * Optional. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null + */ + public function getStreamingAudioConfig() + { + return $this->streaming_audio_config; + } + + public function hasStreamingAudioConfig() + { + return isset($this->streaming_audio_config); + } + + public function clearStreamingAudioConfig() + { + unset($this->streaming_audio_config); + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var + * @return $this + */ + public function setStreamingAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); + $this->streaming_audio_config = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php new file mode 100644 index 000000000000..4f79a5b8ca0d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php @@ -0,0 +1,118 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeRequest + */ +class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message +{ + protected $streaming_request; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null + */ + public function getStreamingConfig() + { + return $this->readOneof(1); + } + + public function hasStreamingConfig() + { + return $this->hasOneof(1); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var + * @return $this + */ + public function setStreamingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null + */ + public function getInput() + { + return $this->readOneof(2); + } + + public function hasInput() + { + return $this->hasOneof(2); + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getStreamingRequest() + { + return $this->whichOneof("streaming_request"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php new file mode 100644 index 000000000000..c817aee908d9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeResponse + */ +class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php new file mode 100644 index 000000000000..45bae6a448ea --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php @@ -0,0 +1,323 @@ +google.cloud.texttospeech.v1.SynthesisInput + */ +class SynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. + * @type string $markup + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * @type string $ssml + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * @type string $prompt + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @return string + */ + public function getSsml() + { + return $this->readOneof(2); + } + + public function hasSsml() + { + return $this->hasOneof(2); + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @param string $var + * @return $this + */ + public function setSsml($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(4); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(4); + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php new file mode 100644 index 000000000000..a7081c28ca1b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php @@ -0,0 +1,166 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata + */ +class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @deprecated + */ + protected $last_update_time = null; + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + */ + protected $progress_percentage = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * @type \Google\Protobuf\Timestamp $last_update_time + * Deprecated. Do not use. + * @type float $progress_percentage + * The progress of the most recent processing update in percentage, ie. 70.0%. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + unset($this->last_update_time); + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setLastUpdateTime($var) + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @return float + */ + public function getProgressPercentage() + { + return $this->progress_percentage; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @param float $var + * @return $this + */ + public function setProgressPercentage($var) + { + GPBUtil::checkDouble($var); + $this->progress_percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php new file mode 100644 index 000000000000..a53081392bfa --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php @@ -0,0 +1,246 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioRequest + */ +class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_gcs_uri = ''; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type string $output_gcs_uri + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputGcsUri() + { + return $this->output_gcs_uri; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputGcsUri($var) + { + GPBUtil::checkString($var, True); + $this->output_gcs_uri = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php new file mode 100644 index 000000000000..e945932a1d90 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php @@ -0,0 +1,33 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioResponse + */ +class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php new file mode 100644 index 000000000000..2bb1c38b3c20 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php @@ -0,0 +1,226 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechRequest + */ +class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; + + /** + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. + * + * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest + * + * @experimental + */ + public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self + { + return (new self()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php new file mode 100644 index 000000000000..680f77554cac --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php @@ -0,0 +1,83 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechResponse + */ +class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php new file mode 100644 index 000000000000..d1b762b4b09e --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.Voice + */ +class Voice extends \Google\Protobuf\Internal\Message +{ + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + */ + private $language_codes; + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + */ + protected $natural_sample_rate_hertz = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $language_codes + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * @type string $name + * The name of this voice. Each distinct voice has a unique name. + * @type int $ssml_gender + * The gender of this voice. + * @type int $natural_sample_rate_hertz + * The natural sample rate (in hertz) for this voice. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @return RepeatedField + */ + public function getLanguageCodes() + { + return $this->language_codes; + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @param string[] $var + * @return $this + */ + public function setLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_codes = $arr; + + return $this; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @return int + */ + public function getNaturalSampleRateHertz() + { + return $this->natural_sample_rate_hertz; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @param int $var + * @return $this + */ + public function setNaturalSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->natural_sample_rate_hertz = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php new file mode 100644 index 000000000000..b16e4fb4438d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.VoiceCloneParams + */ +class VoiceCloneParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice_cloning_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $voice_cloning_key + * Required. Created by GenerateVoiceCloningKey. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVoiceCloningKey() + { + return $this->voice_cloning_key; + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVoiceCloningKey($var) + { + GPBUtil::checkString($var, True); + $this->voice_cloning_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php new file mode 100644 index 000000000000..8168d4784067 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php @@ -0,0 +1,393 @@ +google.cloud.texttospeech.v1.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + */ + protected $custom_voice = null; + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice_clone = null; + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_name = ''; + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $multi_speaker_voice_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * @type string $name + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * @type int $ssml_gender + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * @type string $model_name + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null + */ + public function getCustomVoice() + { + return $this->custom_voice; + } + + public function hasCustomVoice() + { + return isset($this->custom_voice); + } + + public function clearCustomVoice() + { + unset($this->custom_voice); + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var + * @return $this + */ + public function setCustomVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); + $this->custom_voice = $var; + + return $this; + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null + */ + public function getVoiceClone() + { + return $this->voice_clone; + } + + public function hasVoiceClone() + { + return isset($this->voice_clone); + } + + public function clearVoiceClone() + { + unset($this->voice_clone); + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var + * @return $this + */ + public function setVoiceClone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); + $this->voice_clone = $var; + + return $this; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelName() + { + return $this->model_name; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelName($var) + { + GPBUtil::checkString($var, True); + $this->model_name = $var; + + return $this; + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null + */ + public function getMultiSpeakerVoiceConfig() + { + return $this->multi_speaker_voice_config; + } + + public function hasMultiSpeakerVoiceConfig() + { + return isset($this->multi_speaker_voice_config); + } + + public function clearMultiSpeakerVoiceConfig() + { + unset($this->multi_speaker_voice_config); + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var + * @return $this + */ + public function setMultiSpeakerVoiceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); + $this->multi_speaker_voice_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php new file mode 100644 index 000000000000..63287fc46efb --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php @@ -0,0 +1,57 @@ +listVoices($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php new file mode 100644 index 000000000000..71c34862135f --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php @@ -0,0 +1,64 @@ +streamingSynthesize(); + $stream->writeAll([$request,]); + + /** @var StreamingSynthesizeResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php new file mode 100644 index 000000000000..b1cc1a69e31c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php @@ -0,0 +1,94 @@ +setLanguageCode($voiceLanguageCode); + $audioConfig = (new AudioConfig()) + ->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var SynthesizeSpeechResponse $response */ + $response = $textToSpeechClient->synthesizeSpeech($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $voiceLanguageCode = '[LANGUAGE_CODE]'; + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php new file mode 100644 index 000000000000..0ba4a026bd4b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php @@ -0,0 +1,89 @@ +setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SynthesizeLongAudioResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_long_audio_sample($audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php new file mode 100644 index 000000000000..066691e4cffd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php @@ -0,0 +1,308 @@ + listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns a list of Voice supported for synthesis. + * + * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . + * + * @example samples/V1/TextToSpeechClient/list_voices.php + * + * @param ListVoicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListVoicesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse + { + return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); + } + + /** + * Performs bidirectional streaming speech synthesis: receives audio while + * sending text. + * + * @example samples/V1/TextToSpeechClient/streaming_synthesize.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingSynthesize(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingSynthesize', null, $callOptions); + } + + /** + * Synthesizes speech synchronously: receive results after all text input + * has been processed. + * + * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . + * + * @example samples/V1/TextToSpeechClient/synthesize_speech.php + * + * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SynthesizeSpeechResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse + { + return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php new file mode 100644 index 000000000000..56bf66fffe09 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php @@ -0,0 +1,310 @@ + synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechLongAudioSynthesizeClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Synthesizes long form text asynchronously. + * + * The async variant is + * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . + * + * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php + * + * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..aef5b6710920 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechGapicClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "StreamingSynthesize": { + "methods": [ + "streamingSynthesize" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + } + } + }, + "TextToSpeechLongAudioSynthesize": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", + "rpcs": { + "SynthesizeLongAudio": { + "methods": [ + "synthesizeLongAudio" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json new file mode 100644 index 000000000000..6aaa36720e99 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeech": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "ListVoices": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamingSynthesize": { + "timeout_millis": 300000 + }, + "SynthesizeSpeech": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php new file mode 100644 index 000000000000..ad4d236b8015 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php @@ -0,0 +1,46 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', + ], + 'StreamingSynthesize' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', + ], + 'SynthesizeSpeech' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json new file mode 100644 index 000000000000..1f2cda4e7cf5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "SynthesizeLongAudio": { + "timeout_millis": 5000000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php new file mode 100644 index 000000000000..c2b2750ecd9d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', + 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php new file mode 100644 index 000000000000..4887663a2925 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php @@ -0,0 +1,65 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php new file mode 100644 index 000000000000..6b0e6a003979 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/voices', + ], + 'SynthesizeSpeech' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/text:synthesize', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php new file mode 100644 index 000000000000..86ed5387e74d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php @@ -0,0 +1,325 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechClient($options); + } + + /** @test */ + public function listVoicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoices($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListVoicesRequest(); + try { + $gapicClient->listVoices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new StreamingSynthesizeResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + $audioContent2 = '-61'; + $expectedResponse2 = new StreamingSynthesizeResponse(); + $expectedResponse2->setAudioContent($audioContent2); + $transport->addResponse($expectedResponse2); + $audioContent3 = '-60'; + $expectedResponse3 = new StreamingSynthesizeResponse(); + $expectedResponse3->setAudioContent($audioContent3); + $transport->addResponse($expectedResponse3); + // Mock request + $request = new StreamingSynthesizeRequest(); + $request2 = new StreamingSynthesizeRequest(); + $request3 = new StreamingSynthesizeRequest(); + $bidi = $gapicClient->streamingSynthesize(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingSynthesize(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new SynthesizeSpeechResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeSpeech($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); + $actualValue = $actualRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualRequestObject->getVoice(); + $this->assertProtobufEquals($voice, $actualValue); + $actualValue = $actualRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + try { + $gapicClient->synthesizeSpeech($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoicesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php new file mode 100644 index 000000000000..0e0de17a71d7 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php @@ -0,0 +1,270 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechLongAudioSynthesizeClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechLongAudioSynthesizeClient($options); + } + + /** @test */ + public function synthesizeLongAudioTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} From 7c262785338b2d2479d08796ab4027d7cadf6053 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 31 Mar 2026 22:41:08 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- TextToSpeech/metadata/V1/CloudTts.php | 2 +- TextToSpeech/src/V1/AdvancedVoiceOptions.php | 141 ++++++- .../HarmBlockThreshold.php | 0 .../V1/AdvancedVoiceOptions/HarmCategory.php | 0 .../V1/AdvancedVoiceOptions/SafetySetting.php | 0 .../AdvancedVoiceOptions/SafetySettings.php | 0 .../src/V1/StreamingSynthesisInput.php | 12 +- .../src/V1/StreamingSynthesizeConfig.php | 44 ++ TextToSpeech/src/V1/SynthesisInput.php | 12 +- .../src/V1/SynthesizeSpeechRequest.php | 14 +- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 -- .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 -- .../TextToSpeech/V1/AdvancedVoiceOptions.php | 230 ---------- .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 --------------- .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 ----- .../V1/CustomPronunciationParams.php | 177 -------- .../PhoneticEncoding.php | 90 ---- .../TextToSpeech/V1/CustomPronunciations.php | 67 --- .../TextToSpeech/V1/CustomVoiceParams.php | 108 ----- .../V1/CustomVoiceParams/ReportedUsage.php | 65 --- .../TextToSpeech/V1/ListVoicesRequest.php | 115 ----- .../TextToSpeech/V1/ListVoicesResponse.php | 67 --- .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 --- .../V1/MultiSpeakerMarkup/Turn.php | 105 ----- .../V1/MultiSpeakerVoiceConfig.php | 72 ---- .../V1/MultispeakerPrebuiltVoice.php | 114 ----- .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ---- .../TextToSpeech/V1/StreamingAudioConfig.php | 155 ------- .../V1/StreamingSynthesisInput.php | 197 --------- .../V1/StreamingSynthesizeConfig.php | 237 ----------- .../V1/StreamingSynthesizeRequest.php | 118 ------ .../V1/StreamingSynthesizeResponse.php | 73 ---- .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 -------------- .../V1/SynthesizeLongAudioMetadata.php | 166 -------- .../V1/SynthesizeLongAudioRequest.php | 246 ----------- .../V1/SynthesizeLongAudioResponse.php | 33 -- .../V1/SynthesizeSpeechRequest.php | 226 ---------- .../V1/SynthesizeSpeechResponse.php | 83 ---- .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 -------- .../TextToSpeech/V1/VoiceCloneParams.php | 67 --- .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ------------------ .../V1/TextToSpeechClient/list_voices.php | 57 --- .../streaming_synthesize.php | 64 --- .../TextToSpeechClient/synthesize_speech.php | 94 ----- .../synthesize_long_audio.php | 89 ---- .../v1/src/V1/Client/TextToSpeechClient.php | 308 -------------- .../TextToSpeechLongAudioSynthesizeClient.php | 310 -------------- .../v1/src/V1/gapic_metadata.json | 47 --- .../text_to_speech_client_config.json | 58 --- .../text_to_speech_descriptor_config.php | 46 -- ...h_long_audio_synthesize_client_config.json | 37 -- ...ong_audio_synthesize_descriptor_config.php | 50 --- ...ng_audio_synthesize_rest_client_config.php | 65 --- .../text_to_speech_rest_client_config.php | 62 --- .../Unit/V1/Client/TextToSpeechClientTest.php | 325 --------------- ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ------------ 56 files changed, 186 insertions(+), 6259 deletions(-) rename {owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech => TextToSpeech/src}/V1/AdvancedVoiceOptions/HarmBlockThreshold.php (100%) rename {owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech => TextToSpeech/src}/V1/AdvancedVoiceOptions/HarmCategory.php (100%) rename {owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech => TextToSpeech/src}/V1/AdvancedVoiceOptions/SafetySetting.php (100%) rename {owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech => TextToSpeech/src}/V1/AdvancedVoiceOptions/SafetySettings.php (100%) delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/TextToSpeech/metadata/V1/CloudTts.php b/TextToSpeech/metadata/V1/CloudTts.php index 6196fc83e23b..09089fee21c9 100644 --- a/TextToSpeech/metadata/V1/CloudTts.php +++ b/TextToSpeech/metadata/V1/CloudTts.php @@ -19,7 +19,7 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xF2'\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8A\x01\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\$\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x06\xE0A\x04\xE0A\x01B \x0A\x1E_low_latency_journey_synthesis\"\xDD\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12W\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x94\x02\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" , true); static::$is_initialized = true; diff --git a/TextToSpeech/src/V1/AdvancedVoiceOptions.php b/TextToSpeech/src/V1/AdvancedVoiceOptions.php index f202d638c3e2..d30dc7f08739 100644 --- a/TextToSpeech/src/V1/AdvancedVoiceOptions.php +++ b/TextToSpeech/src/V1/AdvancedVoiceOptions.php @@ -23,14 +23,29 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message */ protected $low_latency_journey_synthesis = null; /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated */ protected $relax_safety_filters = false; + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $safety_settings = null; + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_textnorm = null; /** * Constructor. @@ -42,10 +57,16 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message * Only for Journey voices. If false, the synthesis is context aware * and has a higher latency. * @type bool $relax_safety_filters - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * @type bool $enable_textnorm + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. * } */ public function __construct($data = NULL) { @@ -92,36 +113,118 @@ public function setLowLatencyJourneySynthesis($var) } /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @return bool + * @deprecated */ public function getRelaxSafetyFilters() { + if ($this->relax_safety_filters !== false) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + } return $this->relax_safety_filters; } /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @param bool $var * @return $this + * @deprecated */ public function setRelaxSafetyFilters($var) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->relax_safety_filters = $var; return $this; } + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null + */ + public function getSafetySettings() + { + return $this->safety_settings; + } + + public function hasSafetySettings() + { + return isset($this->safety_settings); + } + + public function clearSafetySettings() + { + unset($this->safety_settings); + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var + * @return $this + */ + public function setSafetySettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); + $this->safety_settings = $var; + + return $this; + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextnorm() + { + return isset($this->enable_textnorm) ? $this->enable_textnorm : false; + } + + public function hasEnableTextnorm() + { + return isset($this->enable_textnorm); + } + + public function clearEnableTextnorm() + { + unset($this->enable_textnorm); + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextnorm($var) + { + GPBUtil::checkBool($var); + $this->enable_textnorm = $var; + + return $this; + } + } diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php b/TextToSpeech/src/V1/AdvancedVoiceOptions/HarmBlockThreshold.php similarity index 100% rename from owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php rename to TextToSpeech/src/V1/AdvancedVoiceOptions/HarmBlockThreshold.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php b/TextToSpeech/src/V1/AdvancedVoiceOptions/HarmCategory.php similarity index 100% rename from owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php rename to TextToSpeech/src/V1/AdvancedVoiceOptions/HarmCategory.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php b/TextToSpeech/src/V1/AdvancedVoiceOptions/SafetySetting.php similarity index 100% rename from owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php rename to TextToSpeech/src/V1/AdvancedVoiceOptions/SafetySetting.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php b/TextToSpeech/src/V1/AdvancedVoiceOptions/SafetySettings.php similarity index 100% rename from owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php rename to TextToSpeech/src/V1/AdvancedVoiceOptions/SafetySettings.php diff --git a/TextToSpeech/src/V1/StreamingSynthesisInput.php b/TextToSpeech/src/V1/StreamingSynthesisInput.php index 7e1176739a64..49624284bec9 100644 --- a/TextToSpeech/src/V1/StreamingSynthesisInput.php +++ b/TextToSpeech/src/V1/StreamingSynthesisInput.php @@ -34,8 +34,8 @@ class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message * contains complete, terminating sentences, which results in better prosody * in the output audio. * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup * Multi-speaker markup for Gemini TTS. This field may not * be used with any other voices. @@ -84,8 +84,8 @@ public function setText($var) } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -101,8 +101,8 @@ public function hasMarkup() } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php index f41fcec24009..d81c076523d6 100644 --- a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php +++ b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php @@ -40,6 +40,12 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $custom_pronunciations = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; /** * Constructor. @@ -60,6 +66,8 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * In order to customize the pronunciation of a phrase, there must be an exact * match of the phrase in the input types. If using SSML, the phrase must not * be inside a phoneme tag. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. * } */ public function __construct($data = NULL) { @@ -189,5 +197,41 @@ public function setCustomPronunciations($var) return $this; } + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + } diff --git a/TextToSpeech/src/V1/SynthesisInput.php b/TextToSpeech/src/V1/SynthesisInput.php index 192ac5065466..45bae6a448ea 100644 --- a/TextToSpeech/src/V1/SynthesisInput.php +++ b/TextToSpeech/src/V1/SynthesisInput.php @@ -51,8 +51,8 @@ class SynthesisInput extends \Google\Protobuf\Internal\Message * @type string $text * The raw text to be synthesized. * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * @type string $ssml * The SSML document to be synthesized. The SSML document must be valid * and well-formed. Otherwise the RPC will fail and return @@ -115,8 +115,8 @@ public function setText($var) } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -132,8 +132,8 @@ public function hasMarkup() } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php index 79c547bc582b..2bb1c38b3c20 100644 --- a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php +++ b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php @@ -34,9 +34,9 @@ class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message */ protected $audio_config = null; /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; */ protected $advanced_voice_options = null; @@ -70,7 +70,7 @@ public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config * Required. The configuration of the synthesized audio. * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Advanced voice options. + * Optional. Advanced voice options. * } */ public function __construct($data = NULL) { @@ -187,9 +187,9 @@ public function setAudioConfig($var) } /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null */ public function getAdvancedVoiceOptions() @@ -208,9 +208,9 @@ public function clearAdvancedVoiceOptions() } /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var * @return $this */ diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php deleted file mode 100644 index 09089fee21c9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php +++ /dev/null @@ -1,28 +0,0 @@ -internalAddGeneratedFile( - "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php deleted file mode 100644 index 78b5cfdb66d4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php +++ /dev/null @@ -1,30 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php deleted file mode 100644 index d30dc7f08739..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php +++ /dev/null @@ -1,230 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions - */ -class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - */ - protected $low_latency_journey_synthesis = null; - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $relax_safety_filters = false; - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $safety_settings = null; - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_textnorm = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $low_latency_journey_synthesis - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * @type bool $relax_safety_filters - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * @type bool $enable_textnorm - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @return bool - */ - public function getLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; - } - - public function hasLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis); - } - - public function clearLowLatencyJourneySynthesis() - { - unset($this->low_latency_journey_synthesis); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @param bool $var - * @return $this - */ - public function setLowLatencyJourneySynthesis($var) - { - GPBUtil::checkBool($var); - $this->low_latency_journey_synthesis = $var; - - return $this; - } - - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return bool - * @deprecated - */ - public function getRelaxSafetyFilters() - { - if ($this->relax_safety_filters !== false) { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); - } - return $this->relax_safety_filters; - } - - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setRelaxSafetyFilters($var) - { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->relax_safety_filters = $var; - - return $this; - } - - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null - */ - public function getSafetySettings() - { - return $this->safety_settings; - } - - public function hasSafetySettings() - { - return isset($this->safety_settings); - } - - public function clearSafetySettings() - { - unset($this->safety_settings); - } - - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var - * @return $this - */ - public function setSafetySettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); - $this->safety_settings = $var; - - return $this; - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableTextnorm() - { - return isset($this->enable_textnorm) ? $this->enable_textnorm : false; - } - - public function hasEnableTextnorm() - { - return isset($this->enable_textnorm); - } - - public function clearEnableTextnorm() - { - unset($this->enable_textnorm); - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableTextnorm($var) - { - GPBUtil::checkBool($var); - $this->enable_textnorm = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php deleted file mode 100644 index e490622773f8..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php +++ /dev/null @@ -1,329 +0,0 @@ -google.cloud.texttospeech.v1.AudioConfig - */ -class AudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_encoding = 0; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $pitch = 0.0; - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $volume_gain_db = 0.0; - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $sample_rate_hertz = 0; - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - private $effects_profile_id; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * @type float $pitch - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * @type float $volume_gain_db - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * @type string[] $effects_profile_id - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * - * 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. - * - * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getPitch() - { - return $this->pitch; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setPitch($var) - { - GPBUtil::checkDouble($var); - $this->pitch = $var; - - return $this; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getVolumeGainDb() - { - return $this->volume_gain_db; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setVolumeGainDb($var) - { - GPBUtil::checkDouble($var); - $this->volume_gain_db = $var; - - return $this; - } - - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return RepeatedField - */ - public function getEffectsProfileId() - { - return $this->effects_profile_id; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param string[] $var - * @return $this - */ - public function setEffectsProfileId($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->effects_profile_id = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php deleted file mode 100644 index f1840272c122..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.texttospeech.v1.AudioEncoding - */ -class AudioEncoding -{ - /** - * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return - * result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; - */ - const AUDIO_ENCODING_UNSPECIFIED = 0; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Audio content returned as LINEAR16 also contains a WAV header. - * - * Generated from protobuf enum LINEAR16 = 1; - */ - const LINEAR16 = 1; - /** - * MP3 audio at 32kbps. - * - * Generated from protobuf enum MP3 = 2; - */ - const MP3 = 2; - /** - * Opus encoded audio wrapped in an ogg container. The result is a - * file which can be played natively on Android, and in browsers (at least - * Chrome and Firefox). The quality of the encoding is considerably higher - * than MP3 while using approximately the same bitrate. - * - * Generated from protobuf enum OGG_OPUS = 3; - */ - const OGG_OPUS = 3; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - * Audio content returned as MULAW also contains a WAV header. - * - * Generated from protobuf enum MULAW = 5; - */ - const MULAW = 5; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - * Audio content returned as ALAW also contains a WAV header. - * - * Generated from protobuf enum ALAW = 6; - */ - const ALAW = 6; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or - * any other) header. - * - * Generated from protobuf enum PCM = 7; - */ - const PCM = 7; - /** - * M4A audio. - * - * Generated from protobuf enum M4A = 8; - */ - const M4A = 8; - - private static $valueToName = [ - self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', - self::LINEAR16 => 'LINEAR16', - self::MP3 => 'MP3', - self::OGG_OPUS => 'OGG_OPUS', - self::MULAW => 'MULAW', - self::ALAW => 'ALAW', - self::PCM => 'PCM', - self::M4A => 'M4A', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php deleted file mode 100644 index 2c5b30d8ee8c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams - */ -class CustomPronunciationParams extends \Google\Protobuf\Internal\Message -{ - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - */ - protected $phrase = null; - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - */ - protected $phonetic_encoding = null; - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - */ - protected $pronunciation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $phrase - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * @type int $phonetic_encoding - * The phonetic encoding of the phrase. - * @type string $pronunciation - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @return string - */ - public function getPhrase() - { - return isset($this->phrase) ? $this->phrase : ''; - } - - public function hasPhrase() - { - return isset($this->phrase); - } - - public function clearPhrase() - { - unset($this->phrase); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @param string $var - * @return $this - */ - public function setPhrase($var) - { - GPBUtil::checkString($var, True); - $this->phrase = $var; - - return $this; - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @return int - */ - public function getPhoneticEncoding() - { - return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; - } - - public function hasPhoneticEncoding() - { - return isset($this->phonetic_encoding); - } - - public function clearPhoneticEncoding() - { - unset($this->phonetic_encoding); - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @param int $var - * @return $this - */ - public function setPhoneticEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); - $this->phonetic_encoding = $var; - - return $this; - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @return string - */ - public function getPronunciation() - { - return isset($this->pronunciation) ? $this->pronunciation : ''; - } - - public function hasPronunciation() - { - return isset($this->pronunciation); - } - - public function clearPronunciation() - { - unset($this->pronunciation); - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @param string $var - * @return $this - */ - public function setPronunciation($var) - { - GPBUtil::checkString($var, True); - $this->pronunciation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php deleted file mode 100644 index c2402dce74e4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding - */ -class PhoneticEncoding -{ - /** - * Not specified. - * - * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; - */ - const PHONETIC_ENCODING_UNSPECIFIED = 0; - /** - * IPA, such as apple -> ˈæpəl. - * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - * - * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; - */ - const PHONETIC_ENCODING_IPA = 1; - /** - * X-SAMPA, such as apple -> "{p\@l". - * https://en.wikipedia.org/wiki/X-SAMPA - * - * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; - */ - const PHONETIC_ENCODING_X_SAMPA = 2; - /** - * For reading-to-pron conversion to work well, the `pronunciation` field - * should only contain Kanji, Hiragana, and Katakana. - * The pronunciation can also contain pitch accents. - * The start of a pitch phrase is specified with `^` and the down-pitch - * position is specified with `!`, for example: - * phrase:端 pronunciation:^はし - * phrase:箸 pronunciation:^は!し - * phrase:橋 pronunciation:^はし! - * We currently only support the Tokyo dialect, which allows at most one - * down-pitch per phrase (i.e. at most one `!` between `^`). - * - * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - */ - const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - /** - * Used to specify pronunciations for Mandarin words. See - * https://en.wikipedia.org/wiki/Pinyin. - * For example: 朝阳, the pronunciation is "chao2 yang2". The number - * represents the tone, and there is a space between syllables. Neutral - * tones are represented by 5, for example 孩子 "hai2 zi5". - * - * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; - */ - const PHONETIC_ENCODING_PINYIN = 4; - - private static $valueToName = [ - self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', - self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', - self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', - self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', - self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php deleted file mode 100644 index 624e775a9ee3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciations - */ -class CustomPronunciations extends \Google\Protobuf\Internal\Message -{ - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - */ - private $pronunciations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations - * The pronunciation customizations are applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> - */ - public function getPronunciations() - { - return $this->pronunciations; - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var - * @return $this - */ - public function setPronunciations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); - $this->pronunciations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php deleted file mode 100644 index f84c66d01a3a..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams - */ -class CustomVoiceParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $model = ''; - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $reported_usage = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $model - * Required. The name of the AutoML model that synthesizes the custom voice. - * @type int $reported_usage - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return int - * @deprecated - */ - public function getReportedUsage() - { - if ($this->reported_usage !== 0) { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - } - return $this->reported_usage; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - * @deprecated - */ - public function setReportedUsage($var) - { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); - $this->reported_usage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php deleted file mode 100644 index ecec1d4c0cc3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage - */ -class ReportedUsage -{ - /** - * Request with reported usage unspecified will be rejected. - * - * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; - */ - const REPORTED_USAGE_UNSPECIFIED = 0; - /** - * For scenarios where the synthesized audio is not downloadable and can - * only be used once. For example, real-time request in IVR system. - * - * Generated from protobuf enum REALTIME = 1; - */ - const REALTIME = 1; - /** - * For scenarios where the synthesized audio is downloadable and can be - * reused. For example, the synthesized audio is downloaded, stored in - * customer service system and played repeatedly. - * - * Generated from protobuf enum OFFLINE = 2; - */ - const OFFLINE = 2; - - private static $valueToName = [ - self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', - self::REALTIME => 'REALTIME', - self::OFFLINE => 'OFFLINE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php deleted file mode 100644 index 12a0e68e3f6b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesRequest - */ -class ListVoicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - - /** - * @param string $languageCode Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest - * - * @experimental - */ - public static function build(string $languageCode): self - { - return (new self()) - ->setLanguageCode($languageCode); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php deleted file mode 100644 index fa9403399bd4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesResponse - */ -class ListVoicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - */ - private $voices; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices - * The list of voices. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> - */ - public function getVoices() - { - return $this->voices; - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var - * @return $this - */ - public function setVoices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); - $this->voices = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php deleted file mode 100644 index f8f99a09a577..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup - */ -class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $turns; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns - * Required. Speaker turns. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> - */ - public function getTurns() - { - return $this->turns; - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var - * @return $this - */ - public function setTurns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); - $this->turns = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php deleted file mode 100644 index 2a23ef66e117..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn - */ -class Turn extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker = ''; - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $text = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * @type string $text - * Required. The text to speak. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeaker() - { - return $this->speaker; - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeaker($var) - { - GPBUtil::checkString($var, True); - $this->speaker = $var; - - return $this; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php deleted file mode 100644 index 8da52d2fb891..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig - */ -class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $speaker_voice_configs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> - */ - public function getSpeakerVoiceConfigs() - { - return $this->speaker_voice_configs; - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var - * @return $this - */ - public function setSpeakerVoiceConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); - $this->speaker_voice_configs = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php deleted file mode 100644 index 3b6efea63337..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice - */ -class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_alias = ''; - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker_alias - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * @type string $speaker_id - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerAlias() - { - return $this->speaker_alias; - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerAlias($var) - { - GPBUtil::checkString($var, True); - $this->speaker_alias = $var; - - return $this; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerId() - { - return $this->speaker_id; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerId($var) - { - GPBUtil::checkString($var, True); - $this->speaker_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php deleted file mode 100644 index ca9b5bfd29a5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.SsmlVoiceGender - */ -class SsmlVoiceGender -{ - /** - * An unspecified gender. - * In VoiceSelectionParams, this means that the client doesn't care which - * gender the selected voice will have. In the Voice field of - * ListVoicesResponse, this may mean that the voice doesn't fit any of the - * other categories in this enum, or that the gender of the voice isn't known. - * - * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; - */ - const SSML_VOICE_GENDER_UNSPECIFIED = 0; - /** - * A male voice. - * - * Generated from protobuf enum MALE = 1; - */ - const MALE = 1; - /** - * A female voice. - * - * Generated from protobuf enum FEMALE = 2; - */ - const FEMALE = 2; - /** - * A gender-neutral voice. This voice is not yet supported. - * - * Generated from protobuf enum NEUTRAL = 3; - */ - const NEUTRAL = 3; - - private static $valueToName = [ - self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', - self::MALE => 'MALE', - self::FEMALE => 'FEMALE', - self::NEUTRAL => 'NEUTRAL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php deleted file mode 100644 index 95dfe75a3cbd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.texttospeech.v1.StreamingAudioConfig - */ -class StreamingAudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * return an error. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php deleted file mode 100644 index 49624284bec9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesisInput - */ -class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * @type string $prompt - * This is system instruction supported only for controllable voice models. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(7); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(7); - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php deleted file mode 100644 index d81c076523d6..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php +++ /dev/null @@ -1,237 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeConfig - */ -class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $streaming_audio_config = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $advanced_voice_options = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config - * Optional. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null - */ - public function getStreamingAudioConfig() - { - return $this->streaming_audio_config; - } - - public function hasStreamingAudioConfig() - { - return isset($this->streaming_audio_config); - } - - public function clearStreamingAudioConfig() - { - unset($this->streaming_audio_config); - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var - * @return $this - */ - public function setStreamingAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); - $this->streaming_audio_config = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php deleted file mode 100644 index 4f79a5b8ca0d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeRequest - */ -class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message -{ - protected $streaming_request; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null - */ - public function getStreamingConfig() - { - return $this->readOneof(1); - } - - public function hasStreamingConfig() - { - return $this->hasOneof(1); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var - * @return $this - */ - public function setStreamingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null - */ - public function getInput() - { - return $this->readOneof(2); - } - - public function hasInput() - { - return $this->hasOneof(2); - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getStreamingRequest() - { - return $this->whichOneof("streaming_request"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php deleted file mode 100644 index c817aee908d9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeResponse - */ -class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php deleted file mode 100644 index 45bae6a448ea..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php +++ /dev/null @@ -1,323 +0,0 @@ -google.cloud.texttospeech.v1.SynthesisInput - */ -class SynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. - * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * @type string $ssml - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * @type string $prompt - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @return string - */ - public function getSsml() - { - return $this->readOneof(2); - } - - public function hasSsml() - { - return $this->hasOneof(2); - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @param string $var - * @return $this - */ - public function setSsml($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(4); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(4); - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php deleted file mode 100644 index a7081c28ca1b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata - */ -class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @deprecated - */ - protected $last_update_time = null; - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - */ - protected $progress_percentage = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Time when the request was received. - * @type \Google\Protobuf\Timestamp $last_update_time - * Deprecated. Do not use. - * @type float $progress_percentage - * The progress of the most recent processing update in percentage, ie. 70.0%. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @return \Google\Protobuf\Timestamp|null - * @deprecated - */ - public function getLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return $this->last_update_time; - } - - public function hasLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return isset($this->last_update_time); - } - - public function clearLastUpdateTime() - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - unset($this->last_update_time); - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - * @deprecated - */ - public function setLastUpdateTime($var) - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_update_time = $var; - - return $this; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @return float - */ - public function getProgressPercentage() - { - return $this->progress_percentage; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @param float $var - * @return $this - */ - public function setProgressPercentage($var) - { - GPBUtil::checkDouble($var); - $this->progress_percentage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php deleted file mode 100644 index a53081392bfa..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php +++ /dev/null @@ -1,246 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioRequest - */ -class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - */ - protected $parent = ''; - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_gcs_uri = ''; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type string $output_gcs_uri - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getOutputGcsUri() - { - return $this->output_gcs_uri; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setOutputGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->output_gcs_uri = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php deleted file mode 100644 index e945932a1d90..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioResponse - */ -class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php deleted file mode 100644 index 2bb1c38b3c20..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php +++ /dev/null @@ -1,226 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechRequest - */ -class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $advanced_voice_options = null; - - /** - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. - * - * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest - * - * @experimental - */ - public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self - { - return (new self()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php deleted file mode 100644 index 680f77554cac..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechResponse - */ -class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php deleted file mode 100644 index d1b762b4b09e..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.Voice - */ -class Voice extends \Google\Protobuf\Internal\Message -{ - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - */ - private $language_codes; - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - */ - protected $natural_sample_rate_hertz = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string[] $language_codes - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * @type string $name - * The name of this voice. Each distinct voice has a unique name. - * @type int $ssml_gender - * The gender of this voice. - * @type int $natural_sample_rate_hertz - * The natural sample rate (in hertz) for this voice. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @return RepeatedField - */ - public function getLanguageCodes() - { - return $this->language_codes; - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @param string[] $var - * @return $this - */ - public function setLanguageCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->language_codes = $arr; - - return $this; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @return int - */ - public function getNaturalSampleRateHertz() - { - return $this->natural_sample_rate_hertz; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @param int $var - * @return $this - */ - public function setNaturalSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->natural_sample_rate_hertz = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php deleted file mode 100644 index b16e4fb4438d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.VoiceCloneParams - */ -class VoiceCloneParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice_cloning_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $voice_cloning_key - * Required. Created by GenerateVoiceCloningKey. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVoiceCloningKey() - { - return $this->voice_cloning_key; - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVoiceCloningKey($var) - { - GPBUtil::checkString($var, True); - $this->voice_cloning_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php deleted file mode 100644 index 8168d4784067..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php +++ /dev/null @@ -1,393 +0,0 @@ -google.cloud.texttospeech.v1.VoiceSelectionParams - */ -class VoiceSelectionParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $language_code = ''; - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - */ - protected $custom_voice = null; - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $voice_clone = null; - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $model_name = ''; - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $multi_speaker_voice_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * @type string $name - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * @type int $ssml_gender - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * @type string $model_name - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null - */ - public function getCustomVoice() - { - return $this->custom_voice; - } - - public function hasCustomVoice() - { - return isset($this->custom_voice); - } - - public function clearCustomVoice() - { - unset($this->custom_voice); - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var - * @return $this - */ - public function setCustomVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); - $this->custom_voice = $var; - - return $this; - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null - */ - public function getVoiceClone() - { - return $this->voice_clone; - } - - public function hasVoiceClone() - { - return isset($this->voice_clone); - } - - public function clearVoiceClone() - { - unset($this->voice_clone); - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var - * @return $this - */ - public function setVoiceClone($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); - $this->voice_clone = $var; - - return $this; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getModelName() - { - return $this->model_name; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setModelName($var) - { - GPBUtil::checkString($var, True); - $this->model_name = $var; - - return $this; - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null - */ - public function getMultiSpeakerVoiceConfig() - { - return $this->multi_speaker_voice_config; - } - - public function hasMultiSpeakerVoiceConfig() - { - return isset($this->multi_speaker_voice_config); - } - - public function clearMultiSpeakerVoiceConfig() - { - unset($this->multi_speaker_voice_config); - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var - * @return $this - */ - public function setMultiSpeakerVoiceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); - $this->multi_speaker_voice_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php deleted file mode 100644 index 63287fc46efb..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php +++ /dev/null @@ -1,57 +0,0 @@ -listVoices($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php deleted file mode 100644 index 71c34862135f..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php +++ /dev/null @@ -1,64 +0,0 @@ -streamingSynthesize(); - $stream->writeAll([$request,]); - - /** @var StreamingSynthesizeResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php deleted file mode 100644 index b1cc1a69e31c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php +++ /dev/null @@ -1,94 +0,0 @@ -setLanguageCode($voiceLanguageCode); - $audioConfig = (new AudioConfig()) - ->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var SynthesizeSpeechResponse $response */ - $response = $textToSpeechClient->synthesizeSpeech($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $voiceLanguageCode = '[LANGUAGE_CODE]'; - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php deleted file mode 100644 index 0ba4a026bd4b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php +++ /dev/null @@ -1,89 +0,0 @@ -setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var SynthesizeLongAudioResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_long_audio_sample($audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php deleted file mode 100644 index 066691e4cffd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php +++ /dev/null @@ -1,308 +0,0 @@ - listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) - * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Returns a list of Voice supported for synthesis. - * - * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . - * - * @example samples/V1/TextToSpeechClient/list_voices.php - * - * @param ListVoicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ListVoicesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse - { - return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); - } - - /** - * Performs bidirectional streaming speech synthesis: receives audio while - * sending text. - * - * @example samples/V1/TextToSpeechClient/streaming_synthesize.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingSynthesize(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingSynthesize', null, $callOptions); - } - - /** - * Synthesizes speech synchronously: receive results after all text input - * has been processed. - * - * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . - * - * @example samples/V1/TextToSpeechClient/synthesize_speech.php - * - * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SynthesizeSpeechResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse - { - return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php deleted file mode 100644 index 56bf66fffe09..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php +++ /dev/null @@ -1,310 +0,0 @@ - synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechLongAudioSynthesizeClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = $this->descriptors[$methodName]['longRunning'] ?? []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Synthesizes long form text asynchronously. - * - * The async variant is - * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . - * - * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php - * - * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json deleted file mode 100644 index aef5b6710920..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechGapicClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "StreamingSynthesize": { - "methods": [ - "streamingSynthesize" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - } - } - }, - "TextToSpeechLongAudioSynthesize": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", - "rpcs": { - "SynthesizeLongAudio": { - "methods": [ - "synthesizeLongAudio" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json deleted file mode 100644 index 6aaa36720e99..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeech": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "StreamingSynthesize": { - "timeout_millis": 300000 - }, - "SynthesizeSpeech": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php deleted file mode 100644 index ad4d236b8015..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php +++ /dev/null @@ -1,46 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', - ], - 'StreamingSynthesize' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', - ], - 'SynthesizeSpeech' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json deleted file mode 100644 index 1f2cda4e7cf5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "SynthesizeLongAudio": { - "timeout_millis": 5000000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php deleted file mode 100644 index c2b2750ecd9d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php +++ /dev/null @@ -1,50 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', - 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php deleted file mode 100644 index 4887663a2925..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php +++ /dev/null @@ -1,65 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php deleted file mode 100644 index 6b0e6a003979..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/voices', - ], - 'SynthesizeSpeech' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/text:synthesize', - 'body' => '*', - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php deleted file mode 100644 index 86ed5387e74d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php +++ /dev/null @@ -1,325 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechClient($options); - } - - /** @test */ - public function listVoicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoices($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListVoicesRequest(); - try { - $gapicClient->listVoices($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new StreamingSynthesizeResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - $audioContent2 = '-61'; - $expectedResponse2 = new StreamingSynthesizeResponse(); - $expectedResponse2->setAudioContent($audioContent2); - $transport->addResponse($expectedResponse2); - $audioContent3 = '-60'; - $expectedResponse3 = new StreamingSynthesizeResponse(); - $expectedResponse3->setAudioContent($audioContent3); - $transport->addResponse($expectedResponse3); - // Mock request - $request = new StreamingSynthesizeRequest(); - $request2 = new StreamingSynthesizeRequest(); - $request3 = new StreamingSynthesizeRequest(); - $bidi = $gapicClient->streamingSynthesize(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingSynthesize(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new SynthesizeSpeechResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeSpeech($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); - $actualValue = $actualRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualRequestObject->getVoice(); - $this->assertProtobufEquals($voice, $actualValue); - $actualValue = $actualRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - try { - $gapicClient->synthesizeSpeech($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoicesAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php deleted file mode 100644 index 0e0de17a71d7..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php +++ /dev/null @@ -1,270 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechLongAudioSynthesizeClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechLongAudioSynthesizeClient($options); - } - - /** @test */ - public function synthesizeLongAudioTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} From b238010365858bfc6c5943a2e73854037503d0d9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 02:07:08 +0000 Subject: [PATCH 3/6] feat: [Memorystore for Redis Cluster] Add support for Flexible CA feature PiperOrigin-RevId: 891808664 Source-Link: https://github.com/googleapis/googleapis/commit/4a5553840251e1a8395ea9ff2057cdc6e7aa99ae Source-Link: https://github.com/googleapis/googleapis-gen/commit/22c11cd7f00bf34f030012fb2ddb46cd92c809c7 Copy-Tag: eyJwIjoiVGV4dFRvU3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiIyMmMxMWNkN2YwMGJmMzRmMDMwMDEyZmIyZGRiNDZjZDkyYzgwOWM3In0= --- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 ++ .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 ++ .../TextToSpeech/V1/AdvancedVoiceOptions.php | 127 ++++++ .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 +++++++++++++++ .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 +++++ .../V1/CustomPronunciationParams.php | 177 ++++++++ .../PhoneticEncoding.php | 90 ++++ .../TextToSpeech/V1/CustomPronunciations.php | 67 +++ .../TextToSpeech/V1/CustomVoiceParams.php | 108 +++++ .../V1/CustomVoiceParams/ReportedUsage.php | 65 +++ .../TextToSpeech/V1/ListVoicesRequest.php | 115 +++++ .../TextToSpeech/V1/ListVoicesResponse.php | 67 +++ .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 +++ .../V1/MultiSpeakerMarkup/Turn.php | 105 +++++ .../V1/MultiSpeakerVoiceConfig.php | 72 ++++ .../V1/MultispeakerPrebuiltVoice.php | 114 +++++ .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ++++ .../TextToSpeech/V1/StreamingAudioConfig.php | 155 +++++++ .../V1/StreamingSynthesisInput.php | 197 +++++++++ .../V1/StreamingSynthesizeConfig.php | 193 +++++++++ .../V1/StreamingSynthesizeRequest.php | 118 ++++++ .../V1/StreamingSynthesizeResponse.php | 73 ++++ .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 ++++++++++++++ .../V1/SynthesizeLongAudioMetadata.php | 166 ++++++++ .../V1/SynthesizeLongAudioRequest.php | 246 +++++++++++ .../V1/SynthesizeLongAudioResponse.php | 33 ++ .../V1/SynthesizeSpeechRequest.php | 226 ++++++++++ .../V1/SynthesizeSpeechResponse.php | 83 ++++ .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 ++++++++ .../TextToSpeech/V1/VoiceCloneParams.php | 67 +++ .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ++++++++++++++++++ .../V1/TextToSpeechClient/list_voices.php | 57 +++ .../streaming_synthesize.php | 64 +++ .../TextToSpeechClient/synthesize_speech.php | 94 +++++ .../synthesize_long_audio.php | 89 ++++ .../v1/src/V1/Client/TextToSpeechClient.php | 308 ++++++++++++++ .../TextToSpeechLongAudioSynthesizeClient.php | 310 ++++++++++++++ .../v1/src/V1/gapic_metadata.json | 47 +++ .../text_to_speech_client_config.json | 58 +++ .../text_to_speech_descriptor_config.php | 46 ++ ...h_long_audio_synthesize_client_config.json | 37 ++ ...ong_audio_synthesize_descriptor_config.php | 50 +++ ...ng_audio_synthesize_rest_client_config.php | 65 +++ .../text_to_speech_rest_client_config.php | 62 +++ .../Unit/V1/Client/TextToSpeechClientTest.php | 325 +++++++++++++++ ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ++++++++++++ 46 files changed, 6073 insertions(+) create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php new file mode 100644 index 000000000000..6196fc83e23b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\xF2'\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8A\x01\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\$\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x06\xE0A\x04\xE0A\x01B \x0A\x1E_low_latency_journey_synthesis\"\xDD\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12W\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x94\x02\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php new file mode 100644 index 000000000000..78b5cfdb66d4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php new file mode 100644 index 000000000000..f202d638c3e2 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php @@ -0,0 +1,127 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions + */ +class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + */ + protected $low_latency_journey_synthesis = null; + /** + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $relax_safety_filters = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $low_latency_journey_synthesis + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * @type bool $relax_safety_filters + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @return bool + */ + public function getLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; + } + + public function hasLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis); + } + + public function clearLowLatencyJourneySynthesis() + { + unset($this->low_latency_journey_synthesis); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @param bool $var + * @return $this + */ + public function setLowLatencyJourneySynthesis($var) + { + GPBUtil::checkBool($var); + $this->low_latency_journey_synthesis = $var; + + return $this; + } + + /** + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRelaxSafetyFilters() + { + return $this->relax_safety_filters; + } + + /** + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRelaxSafetyFilters($var) + { + GPBUtil::checkBool($var); + $this->relax_safety_filters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php new file mode 100644 index 000000000000..e490622773f8 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php @@ -0,0 +1,329 @@ +google.cloud.texttospeech.v1.AudioConfig + */ +class AudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * @type float $pitch + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * @type float $volume_gain_db + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * @type string[] $effects_profile_id + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * + * 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. + * + * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEffectsProfileId() + { + return $this->effects_profile_id; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEffectsProfileId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effects_profile_id = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php new file mode 100644 index 000000000000..f1840272c122 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php @@ -0,0 +1,107 @@ +google.cloud.texttospeech.v1.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return + * result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum LINEAR16 = 1; + */ + const LINEAR16 = 1; + /** + * MP3 audio at 32kbps. + * + * Generated from protobuf enum MP3 = 2; + */ + const MP3 = 2; + /** + * Opus encoded audio wrapped in an ogg container. The result is a + * file which can be played natively on Android, and in browsers (at least + * Chrome and Firefox). The quality of the encoding is considerably higher + * than MP3 while using approximately the same bitrate. + * + * Generated from protobuf enum OGG_OPUS = 3; + */ + const OGG_OPUS = 3; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * Audio content returned as MULAW also contains a WAV header. + * + * Generated from protobuf enum MULAW = 5; + */ + const MULAW = 5; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + * Audio content returned as ALAW also contains a WAV header. + * + * Generated from protobuf enum ALAW = 6; + */ + const ALAW = 6; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or + * any other) header. + * + * Generated from protobuf enum PCM = 7; + */ + const PCM = 7; + /** + * M4A audio. + * + * Generated from protobuf enum M4A = 8; + */ + const M4A = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::LINEAR16 => 'LINEAR16', + self::MP3 => 'MP3', + self::OGG_OPUS => 'OGG_OPUS', + self::MULAW => 'MULAW', + self::ALAW => 'ALAW', + self::PCM => 'PCM', + self::M4A => 'M4A', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php new file mode 100644 index 000000000000..2c5b30d8ee8c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams + */ +class CustomPronunciationParams extends \Google\Protobuf\Internal\Message +{ + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + */ + protected $phrase = null; + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + */ + protected $phonetic_encoding = null; + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + */ + protected $pronunciation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $phrase + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * @type int $phonetic_encoding + * The phonetic encoding of the phrase. + * @type string $pronunciation + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @return string + */ + public function getPhrase() + { + return isset($this->phrase) ? $this->phrase : ''; + } + + public function hasPhrase() + { + return isset($this->phrase); + } + + public function clearPhrase() + { + unset($this->phrase); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @param string $var + * @return $this + */ + public function setPhrase($var) + { + GPBUtil::checkString($var, True); + $this->phrase = $var; + + return $this; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @return int + */ + public function getPhoneticEncoding() + { + return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; + } + + public function hasPhoneticEncoding() + { + return isset($this->phonetic_encoding); + } + + public function clearPhoneticEncoding() + { + unset($this->phonetic_encoding); + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @param int $var + * @return $this + */ + public function setPhoneticEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); + $this->phonetic_encoding = $var; + + return $this; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @return string + */ + public function getPronunciation() + { + return isset($this->pronunciation) ? $this->pronunciation : ''; + } + + public function hasPronunciation() + { + return isset($this->pronunciation); + } + + public function clearPronunciation() + { + unset($this->pronunciation); + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @param string $var + * @return $this + */ + public function setPronunciation($var) + { + GPBUtil::checkString($var, True); + $this->pronunciation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php new file mode 100644 index 000000000000..c2402dce74e4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php @@ -0,0 +1,90 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding + */ +class PhoneticEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; + */ + const PHONETIC_ENCODING_UNSPECIFIED = 0; + /** + * IPA, such as apple -> ˈæpəl. + * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + * + * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; + */ + const PHONETIC_ENCODING_IPA = 1; + /** + * X-SAMPA, such as apple -> "{p\@l". + * https://en.wikipedia.org/wiki/X-SAMPA + * + * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; + */ + const PHONETIC_ENCODING_X_SAMPA = 2; + /** + * For reading-to-pron conversion to work well, the `pronunciation` field + * should only contain Kanji, Hiragana, and Katakana. + * The pronunciation can also contain pitch accents. + * The start of a pitch phrase is specified with `^` and the down-pitch + * position is specified with `!`, for example: + * phrase:端 pronunciation:^はし + * phrase:箸 pronunciation:^は!し + * phrase:橋 pronunciation:^はし! + * We currently only support the Tokyo dialect, which allows at most one + * down-pitch per phrase (i.e. at most one `!` between `^`). + * + * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + */ + const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + /** + * Used to specify pronunciations for Mandarin words. See + * https://en.wikipedia.org/wiki/Pinyin. + * For example: 朝阳, the pronunciation is "chao2 yang2". The number + * represents the tone, and there is a space between syllables. Neutral + * tones are represented by 5, for example 孩子 "hai2 zi5". + * + * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; + */ + const PHONETIC_ENCODING_PINYIN = 4; + + private static $valueToName = [ + self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', + self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', + self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', + self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', + self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php new file mode 100644 index 000000000000..624e775a9ee3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.CustomPronunciations + */ +class CustomPronunciations extends \Google\Protobuf\Internal\Message +{ + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + */ + private $pronunciations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations + * The pronunciation customizations are applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> + */ + public function getPronunciations() + { + return $this->pronunciations; + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var + * @return $this + */ + public function setPronunciations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); + $this->pronunciations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php new file mode 100644 index 000000000000..f84c66d01a3a --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php @@ -0,0 +1,108 @@ +google.cloud.texttospeech.v1.CustomVoiceParams + */ +class CustomVoiceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $model = ''; + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $reported_usage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Required. The name of the AutoML model that synthesizes the custom voice. + * @type int $reported_usage + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return int + * @deprecated + */ + public function getReportedUsage() + { + if ($this->reported_usage !== 0) { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + } + return $this->reported_usage; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + * @deprecated + */ + public function setReportedUsage($var) + { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); + $this->reported_usage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php new file mode 100644 index 000000000000..ecec1d4c0cc3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php @@ -0,0 +1,65 @@ +google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage + */ +class ReportedUsage +{ + /** + * Request with reported usage unspecified will be rejected. + * + * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; + */ + const REPORTED_USAGE_UNSPECIFIED = 0; + /** + * For scenarios where the synthesized audio is not downloadable and can + * only be used once. For example, real-time request in IVR system. + * + * Generated from protobuf enum REALTIME = 1; + */ + const REALTIME = 1; + /** + * For scenarios where the synthesized audio is downloadable and can be + * reused. For example, the synthesized audio is downloaded, stored in + * customer service system and played repeatedly. + * + * Generated from protobuf enum OFFLINE = 2; + */ + const OFFLINE = 2; + + private static $valueToName = [ + self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', + self::REALTIME => 'REALTIME', + self::OFFLINE => 'OFFLINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php new file mode 100644 index 000000000000..12a0e68e3f6b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php @@ -0,0 +1,115 @@ +google.cloud.texttospeech.v1.ListVoicesRequest + */ +class ListVoicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $languageCode Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest + * + * @experimental + */ + public static function build(string $languageCode): self + { + return (new self()) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php new file mode 100644 index 000000000000..fa9403399bd4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.ListVoicesResponse + */ +class ListVoicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + */ + private $voices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices + * The list of voices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> + */ + public function getVoices() + { + return $this->voices; + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var + * @return $this + */ + public function setVoices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); + $this->voices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php new file mode 100644 index 000000000000..f8f99a09a577 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup + */ +class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $turns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns + * Required. Speaker turns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> + */ + public function getTurns() + { + return $this->turns; + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var + * @return $this + */ + public function setTurns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); + $this->turns = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php new file mode 100644 index 000000000000..2a23ef66e117 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php @@ -0,0 +1,105 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + */ +class Turn extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker = ''; + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * @type string $text + * Required. The text to speak. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeaker() + { + return $this->speaker; + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeaker($var) + { + GPBUtil::checkString($var, True); + $this->speaker = $var; + + return $this; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php new file mode 100644 index 000000000000..8da52d2fb891 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php @@ -0,0 +1,72 @@ +google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig + */ +class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $speaker_voice_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> + */ + public function getSpeakerVoiceConfigs() + { + return $this->speaker_voice_configs; + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var + * @return $this + */ + public function setSpeakerVoiceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); + $this->speaker_voice_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php new file mode 100644 index 000000000000..3b6efea63337 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php @@ -0,0 +1,114 @@ +google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice + */ +class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_alias = ''; + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker_alias + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * @type string $speaker_id + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerAlias() + { + return $this->speaker_alias; + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerAlias($var) + { + GPBUtil::checkString($var, True); + $this->speaker_alias = $var; + + return $this; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerId() + { + return $this->speaker_id; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerId($var) + { + GPBUtil::checkString($var, True); + $this->speaker_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php new file mode 100644 index 000000000000..ca9b5bfd29a5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.SsmlVoiceGender + */ +class SsmlVoiceGender +{ + /** + * An unspecified gender. + * In VoiceSelectionParams, this means that the client doesn't care which + * gender the selected voice will have. In the Voice field of + * ListVoicesResponse, this may mean that the voice doesn't fit any of the + * other categories in this enum, or that the gender of the voice isn't known. + * + * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + const SSML_VOICE_GENDER_UNSPECIFIED = 0; + /** + * A male voice. + * + * Generated from protobuf enum MALE = 1; + */ + const MALE = 1; + /** + * A female voice. + * + * Generated from protobuf enum FEMALE = 2; + */ + const FEMALE = 2; + /** + * A gender-neutral voice. This voice is not yet supported. + * + * Generated from protobuf enum NEUTRAL = 3; + */ + const NEUTRAL = 3; + + private static $valueToName = [ + self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', + self::MALE => 'MALE', + self::FEMALE => 'FEMALE', + self::NEUTRAL => 'NEUTRAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php new file mode 100644 index 000000000000..95dfe75a3cbd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php @@ -0,0 +1,155 @@ +google.cloud.texttospeech.v1.StreamingAudioConfig + */ +class StreamingAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * return an error. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php new file mode 100644 index 000000000000..7e1176739a64 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php @@ -0,0 +1,197 @@ +google.cloud.texttospeech.v1.StreamingSynthesisInput + */ +class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * @type string $markup + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * @type string $prompt + * This is system instruction supported only for controllable voice models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(7); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(7); + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php new file mode 100644 index 000000000000..f41fcec24009 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php @@ -0,0 +1,193 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeConfig + */ +class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $streaming_audio_config = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config + * Optional. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null + */ + public function getStreamingAudioConfig() + { + return $this->streaming_audio_config; + } + + public function hasStreamingAudioConfig() + { + return isset($this->streaming_audio_config); + } + + public function clearStreamingAudioConfig() + { + unset($this->streaming_audio_config); + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var + * @return $this + */ + public function setStreamingAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); + $this->streaming_audio_config = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php new file mode 100644 index 000000000000..4f79a5b8ca0d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php @@ -0,0 +1,118 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeRequest + */ +class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message +{ + protected $streaming_request; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null + */ + public function getStreamingConfig() + { + return $this->readOneof(1); + } + + public function hasStreamingConfig() + { + return $this->hasOneof(1); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var + * @return $this + */ + public function setStreamingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null + */ + public function getInput() + { + return $this->readOneof(2); + } + + public function hasInput() + { + return $this->hasOneof(2); + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getStreamingRequest() + { + return $this->whichOneof("streaming_request"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php new file mode 100644 index 000000000000..c817aee908d9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeResponse + */ +class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php new file mode 100644 index 000000000000..192ac5065466 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php @@ -0,0 +1,323 @@ +google.cloud.texttospeech.v1.SynthesisInput + */ +class SynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. + * @type string $markup + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * @type string $ssml + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * @type string $prompt + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for HD voices specifically. This field may not be used with any + * other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @return string + */ + public function getSsml() + { + return $this->readOneof(2); + } + + public function hasSsml() + { + return $this->hasOneof(2); + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @param string $var + * @return $this + */ + public function setSsml($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(4); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(4); + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php new file mode 100644 index 000000000000..a7081c28ca1b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php @@ -0,0 +1,166 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata + */ +class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @deprecated + */ + protected $last_update_time = null; + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + */ + protected $progress_percentage = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * @type \Google\Protobuf\Timestamp $last_update_time + * Deprecated. Do not use. + * @type float $progress_percentage + * The progress of the most recent processing update in percentage, ie. 70.0%. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + unset($this->last_update_time); + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setLastUpdateTime($var) + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @return float + */ + public function getProgressPercentage() + { + return $this->progress_percentage; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @param float $var + * @return $this + */ + public function setProgressPercentage($var) + { + GPBUtil::checkDouble($var); + $this->progress_percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php new file mode 100644 index 000000000000..a53081392bfa --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php @@ -0,0 +1,246 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioRequest + */ +class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_gcs_uri = ''; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type string $output_gcs_uri + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputGcsUri() + { + return $this->output_gcs_uri; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputGcsUri($var) + { + GPBUtil::checkString($var, True); + $this->output_gcs_uri = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php new file mode 100644 index 000000000000..e945932a1d90 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php @@ -0,0 +1,33 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioResponse + */ +class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php new file mode 100644 index 000000000000..79c547bc582b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php @@ -0,0 +1,226 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechRequest + */ +class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + */ + protected $advanced_voice_options = null; + + /** + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. + * + * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest + * + * @experimental + */ + public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self + { + return (new self()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Advanced voice options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php new file mode 100644 index 000000000000..680f77554cac --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php @@ -0,0 +1,83 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechResponse + */ +class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php new file mode 100644 index 000000000000..d1b762b4b09e --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.Voice + */ +class Voice extends \Google\Protobuf\Internal\Message +{ + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + */ + private $language_codes; + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + */ + protected $natural_sample_rate_hertz = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $language_codes + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * @type string $name + * The name of this voice. Each distinct voice has a unique name. + * @type int $ssml_gender + * The gender of this voice. + * @type int $natural_sample_rate_hertz + * The natural sample rate (in hertz) for this voice. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @return RepeatedField + */ + public function getLanguageCodes() + { + return $this->language_codes; + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @param string[] $var + * @return $this + */ + public function setLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_codes = $arr; + + return $this; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @return int + */ + public function getNaturalSampleRateHertz() + { + return $this->natural_sample_rate_hertz; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @param int $var + * @return $this + */ + public function setNaturalSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->natural_sample_rate_hertz = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php new file mode 100644 index 000000000000..b16e4fb4438d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.VoiceCloneParams + */ +class VoiceCloneParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice_cloning_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $voice_cloning_key + * Required. Created by GenerateVoiceCloningKey. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVoiceCloningKey() + { + return $this->voice_cloning_key; + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVoiceCloningKey($var) + { + GPBUtil::checkString($var, True); + $this->voice_cloning_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php new file mode 100644 index 000000000000..8168d4784067 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php @@ -0,0 +1,393 @@ +google.cloud.texttospeech.v1.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + */ + protected $custom_voice = null; + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice_clone = null; + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_name = ''; + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $multi_speaker_voice_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * @type string $name + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * @type int $ssml_gender + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * @type string $model_name + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null + */ + public function getCustomVoice() + { + return $this->custom_voice; + } + + public function hasCustomVoice() + { + return isset($this->custom_voice); + } + + public function clearCustomVoice() + { + unset($this->custom_voice); + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var + * @return $this + */ + public function setCustomVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); + $this->custom_voice = $var; + + return $this; + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null + */ + public function getVoiceClone() + { + return $this->voice_clone; + } + + public function hasVoiceClone() + { + return isset($this->voice_clone); + } + + public function clearVoiceClone() + { + unset($this->voice_clone); + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var + * @return $this + */ + public function setVoiceClone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); + $this->voice_clone = $var; + + return $this; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelName() + { + return $this->model_name; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelName($var) + { + GPBUtil::checkString($var, True); + $this->model_name = $var; + + return $this; + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null + */ + public function getMultiSpeakerVoiceConfig() + { + return $this->multi_speaker_voice_config; + } + + public function hasMultiSpeakerVoiceConfig() + { + return isset($this->multi_speaker_voice_config); + } + + public function clearMultiSpeakerVoiceConfig() + { + unset($this->multi_speaker_voice_config); + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var + * @return $this + */ + public function setMultiSpeakerVoiceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); + $this->multi_speaker_voice_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php new file mode 100644 index 000000000000..63287fc46efb --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php @@ -0,0 +1,57 @@ +listVoices($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php new file mode 100644 index 000000000000..71c34862135f --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php @@ -0,0 +1,64 @@ +streamingSynthesize(); + $stream->writeAll([$request,]); + + /** @var StreamingSynthesizeResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php new file mode 100644 index 000000000000..b1cc1a69e31c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php @@ -0,0 +1,94 @@ +setLanguageCode($voiceLanguageCode); + $audioConfig = (new AudioConfig()) + ->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var SynthesizeSpeechResponse $response */ + $response = $textToSpeechClient->synthesizeSpeech($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $voiceLanguageCode = '[LANGUAGE_CODE]'; + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php new file mode 100644 index 000000000000..0ba4a026bd4b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php @@ -0,0 +1,89 @@ +setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SynthesizeLongAudioResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_long_audio_sample($audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php new file mode 100644 index 000000000000..066691e4cffd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php @@ -0,0 +1,308 @@ + listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns a list of Voice supported for synthesis. + * + * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . + * + * @example samples/V1/TextToSpeechClient/list_voices.php + * + * @param ListVoicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListVoicesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse + { + return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); + } + + /** + * Performs bidirectional streaming speech synthesis: receives audio while + * sending text. + * + * @example samples/V1/TextToSpeechClient/streaming_synthesize.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingSynthesize(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingSynthesize', null, $callOptions); + } + + /** + * Synthesizes speech synchronously: receive results after all text input + * has been processed. + * + * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . + * + * @example samples/V1/TextToSpeechClient/synthesize_speech.php + * + * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SynthesizeSpeechResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse + { + return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php new file mode 100644 index 000000000000..56bf66fffe09 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php @@ -0,0 +1,310 @@ + synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechLongAudioSynthesizeClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Synthesizes long form text asynchronously. + * + * The async variant is + * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . + * + * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php + * + * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..aef5b6710920 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechGapicClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "StreamingSynthesize": { + "methods": [ + "streamingSynthesize" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + } + } + }, + "TextToSpeechLongAudioSynthesize": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", + "rpcs": { + "SynthesizeLongAudio": { + "methods": [ + "synthesizeLongAudio" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json new file mode 100644 index 000000000000..6aaa36720e99 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeech": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "ListVoices": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamingSynthesize": { + "timeout_millis": 300000 + }, + "SynthesizeSpeech": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php new file mode 100644 index 000000000000..ad4d236b8015 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php @@ -0,0 +1,46 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', + ], + 'StreamingSynthesize' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', + ], + 'SynthesizeSpeech' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json new file mode 100644 index 000000000000..1f2cda4e7cf5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "SynthesizeLongAudio": { + "timeout_millis": 5000000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php new file mode 100644 index 000000000000..c2b2750ecd9d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', + 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php new file mode 100644 index 000000000000..4887663a2925 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php @@ -0,0 +1,65 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php new file mode 100644 index 000000000000..6b0e6a003979 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/voices', + ], + 'SynthesizeSpeech' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/text:synthesize', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php new file mode 100644 index 000000000000..86ed5387e74d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php @@ -0,0 +1,325 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechClient($options); + } + + /** @test */ + public function listVoicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoices($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListVoicesRequest(); + try { + $gapicClient->listVoices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new StreamingSynthesizeResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + $audioContent2 = '-61'; + $expectedResponse2 = new StreamingSynthesizeResponse(); + $expectedResponse2->setAudioContent($audioContent2); + $transport->addResponse($expectedResponse2); + $audioContent3 = '-60'; + $expectedResponse3 = new StreamingSynthesizeResponse(); + $expectedResponse3->setAudioContent($audioContent3); + $transport->addResponse($expectedResponse3); + // Mock request + $request = new StreamingSynthesizeRequest(); + $request2 = new StreamingSynthesizeRequest(); + $request3 = new StreamingSynthesizeRequest(); + $bidi = $gapicClient->streamingSynthesize(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingSynthesize(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new SynthesizeSpeechResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeSpeech($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); + $actualValue = $actualRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualRequestObject->getVoice(); + $this->assertProtobufEquals($voice, $actualValue); + $actualValue = $actualRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + try { + $gapicClient->synthesizeSpeech($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoicesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php new file mode 100644 index 000000000000..0e0de17a71d7 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php @@ -0,0 +1,270 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechLongAudioSynthesizeClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechLongAudioSynthesizeClient($options); + } + + /** @test */ + public function synthesizeLongAudioTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} From fafa128af5c0cc9714075bdda6a2c4fa8ca0b8c3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 02:09:47 +0000 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- TextToSpeech/metadata/V1/CloudTts.php | 2 +- TextToSpeech/src/V1/AdvancedVoiceOptions.php | 141 +------ .../src/V1/StreamingSynthesisInput.php | 12 +- .../src/V1/StreamingSynthesizeConfig.php | 44 -- TextToSpeech/src/V1/SynthesisInput.php | 12 +- .../src/V1/SynthesizeSpeechRequest.php | 14 +- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 -- .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 -- .../TextToSpeech/V1/AdvancedVoiceOptions.php | 127 ------ .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 --------------- .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 ----- .../V1/CustomPronunciationParams.php | 177 -------- .../PhoneticEncoding.php | 90 ---- .../TextToSpeech/V1/CustomPronunciations.php | 67 --- .../TextToSpeech/V1/CustomVoiceParams.php | 108 ----- .../V1/CustomVoiceParams/ReportedUsage.php | 65 --- .../TextToSpeech/V1/ListVoicesRequest.php | 115 ----- .../TextToSpeech/V1/ListVoicesResponse.php | 67 --- .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 --- .../V1/MultiSpeakerMarkup/Turn.php | 105 ----- .../V1/MultiSpeakerVoiceConfig.php | 72 ---- .../V1/MultispeakerPrebuiltVoice.php | 114 ----- .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ---- .../TextToSpeech/V1/StreamingAudioConfig.php | 155 ------- .../V1/StreamingSynthesisInput.php | 197 --------- .../V1/StreamingSynthesizeConfig.php | 193 --------- .../V1/StreamingSynthesizeRequest.php | 118 ------ .../V1/StreamingSynthesizeResponse.php | 73 ---- .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 -------------- .../V1/SynthesizeLongAudioMetadata.php | 166 -------- .../V1/SynthesizeLongAudioRequest.php | 246 ----------- .../V1/SynthesizeLongAudioResponse.php | 33 -- .../V1/SynthesizeSpeechRequest.php | 226 ---------- .../V1/SynthesizeSpeechResponse.php | 83 ---- .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 -------- .../TextToSpeech/V1/VoiceCloneParams.php | 67 --- .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ------------------ .../V1/TextToSpeechClient/list_voices.php | 57 --- .../streaming_synthesize.php | 64 --- .../TextToSpeechClient/synthesize_speech.php | 94 ----- .../synthesize_long_audio.php | 89 ---- .../v1/src/V1/Client/TextToSpeechClient.php | 308 -------------- .../TextToSpeechLongAudioSynthesizeClient.php | 310 -------------- .../v1/src/V1/gapic_metadata.json | 47 --- .../text_to_speech_client_config.json | 58 --- .../text_to_speech_descriptor_config.php | 46 -- ...h_long_audio_synthesize_client_config.json | 37 -- ...ong_audio_synthesize_descriptor_config.php | 50 --- ...ng_audio_synthesize_rest_client_config.php | 65 --- .../text_to_speech_rest_client_config.php | 62 --- .../Unit/V1/Client/TextToSpeechClientTest.php | 325 --------------- ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ------------ 52 files changed, 39 insertions(+), 6259 deletions(-) delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/TextToSpeech/metadata/V1/CloudTts.php b/TextToSpeech/metadata/V1/CloudTts.php index 09089fee21c9..6196fc83e23b 100644 --- a/TextToSpeech/metadata/V1/CloudTts.php +++ b/TextToSpeech/metadata/V1/CloudTts.php @@ -19,7 +19,7 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + "\x0A\xF2'\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8A\x01\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\$\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x06\xE0A\x04\xE0A\x01B \x0A\x1E_low_latency_journey_synthesis\"\xDD\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12W\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x94\x02\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" , true); static::$is_initialized = true; diff --git a/TextToSpeech/src/V1/AdvancedVoiceOptions.php b/TextToSpeech/src/V1/AdvancedVoiceOptions.php index d30dc7f08739..f202d638c3e2 100644 --- a/TextToSpeech/src/V1/AdvancedVoiceOptions.php +++ b/TextToSpeech/src/V1/AdvancedVoiceOptions.php @@ -23,29 +23,14 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message */ protected $low_latency_journey_synthesis = null; /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ protected $relax_safety_filters = false; - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $safety_settings = null; - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_textnorm = null; /** * Constructor. @@ -57,16 +42,10 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message * Only for Journey voices. If false, the synthesis is context aware * and has a higher latency. * @type bool $relax_safety_filters - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * @type bool $enable_textnorm - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. * } */ public function __construct($data = NULL) { @@ -113,118 +92,36 @@ public function setLowLatencyJourneySynthesis($var) } /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @return bool - * @deprecated */ public function getRelaxSafetyFilters() { - if ($this->relax_safety_filters !== false) { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); - } return $this->relax_safety_filters; } /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. + * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + * Otherwise, will return result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @param bool $var * @return $this - * @deprecated */ public function setRelaxSafetyFilters($var) { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->relax_safety_filters = $var; return $this; } - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null - */ - public function getSafetySettings() - { - return $this->safety_settings; - } - - public function hasSafetySettings() - { - return isset($this->safety_settings); - } - - public function clearSafetySettings() - { - unset($this->safety_settings); - } - - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var - * @return $this - */ - public function setSafetySettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); - $this->safety_settings = $var; - - return $this; - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableTextnorm() - { - return isset($this->enable_textnorm) ? $this->enable_textnorm : false; - } - - public function hasEnableTextnorm() - { - return isset($this->enable_textnorm); - } - - public function clearEnableTextnorm() - { - unset($this->enable_textnorm); - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableTextnorm($var) - { - GPBUtil::checkBool($var); - $this->enable_textnorm = $var; - - return $this; - } - } diff --git a/TextToSpeech/src/V1/StreamingSynthesisInput.php b/TextToSpeech/src/V1/StreamingSynthesisInput.php index 49624284bec9..7e1176739a64 100644 --- a/TextToSpeech/src/V1/StreamingSynthesisInput.php +++ b/TextToSpeech/src/V1/StreamingSynthesisInput.php @@ -34,8 +34,8 @@ class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message * contains complete, terminating sentences, which results in better prosody * in the output audio. * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup * Multi-speaker markup for Gemini TTS. This field may not * be used with any other voices. @@ -84,8 +84,8 @@ public function setText($var) } /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -101,8 +101,8 @@ public function hasMarkup() } /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php index d81c076523d6..f41fcec24009 100644 --- a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php +++ b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php @@ -40,12 +40,6 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $custom_pronunciations = null; - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $advanced_voice_options = null; /** * Constructor. @@ -66,8 +60,6 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * In order to customize the pronunciation of a phrase, there must be an exact * match of the phrase in the input types. If using SSML, the phrase must not * be inside a phoneme tag. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. * } */ public function __construct($data = NULL) { @@ -197,41 +189,5 @@ public function setCustomPronunciations($var) return $this; } - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - } diff --git a/TextToSpeech/src/V1/SynthesisInput.php b/TextToSpeech/src/V1/SynthesisInput.php index 45bae6a448ea..192ac5065466 100644 --- a/TextToSpeech/src/V1/SynthesisInput.php +++ b/TextToSpeech/src/V1/SynthesisInput.php @@ -51,8 +51,8 @@ class SynthesisInput extends \Google\Protobuf\Internal\Message * @type string $text * The raw text to be synthesized. * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * @type string $ssml * The SSML document to be synthesized. The SSML document must be valid * and well-formed. Otherwise the RPC will fail and return @@ -115,8 +115,8 @@ public function setText($var) } /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -132,8 +132,8 @@ public function hasMarkup() } /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. + * Markup for HD voices specifically. This field may not be used with any + * other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php index 2bb1c38b3c20..79c547bc582b 100644 --- a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php +++ b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php @@ -34,9 +34,9 @@ class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message */ protected $audio_config = null; /** - * Optional. Advanced voice options. + * Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; */ protected $advanced_voice_options = null; @@ -70,7 +70,7 @@ public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config * Required. The configuration of the synthesized audio. * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. + * Advanced voice options. * } */ public function __construct($data = NULL) { @@ -187,9 +187,9 @@ public function setAudioConfig($var) } /** - * Optional. Advanced voice options. + * Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null */ public function getAdvancedVoiceOptions() @@ -208,9 +208,9 @@ public function clearAdvancedVoiceOptions() } /** - * Optional. Advanced voice options. + * Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var * @return $this */ diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php deleted file mode 100644 index 6196fc83e23b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php +++ /dev/null @@ -1,28 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xF2'\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8A\x01\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\$\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x06\xE0A\x04\xE0A\x01B \x0A\x1E_low_latency_journey_synthesis\"\xDD\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12W\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x94\x02\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php deleted file mode 100644 index 78b5cfdb66d4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php +++ /dev/null @@ -1,30 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php deleted file mode 100644 index f202d638c3e2..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions - */ -class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - */ - protected $low_latency_journey_synthesis = null; - /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $relax_safety_filters = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $low_latency_journey_synthesis - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * @type bool $relax_safety_filters - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @return bool - */ - public function getLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; - } - - public function hasLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis); - } - - public function clearLowLatencyJourneySynthesis() - { - unset($this->low_latency_journey_synthesis); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @param bool $var - * @return $this - */ - public function setLowLatencyJourneySynthesis($var) - { - GPBUtil::checkBool($var); - $this->low_latency_journey_synthesis = $var; - - return $this; - } - - /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRelaxSafetyFilters() - { - return $this->relax_safety_filters; - } - - /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRelaxSafetyFilters($var) - { - GPBUtil::checkBool($var); - $this->relax_safety_filters = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php deleted file mode 100644 index e490622773f8..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php +++ /dev/null @@ -1,329 +0,0 @@ -google.cloud.texttospeech.v1.AudioConfig - */ -class AudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_encoding = 0; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $pitch = 0.0; - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $volume_gain_db = 0.0; - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $sample_rate_hertz = 0; - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - private $effects_profile_id; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * @type float $pitch - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * @type float $volume_gain_db - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * @type string[] $effects_profile_id - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * - * 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. - * - * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getPitch() - { - return $this->pitch; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setPitch($var) - { - GPBUtil::checkDouble($var); - $this->pitch = $var; - - return $this; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getVolumeGainDb() - { - return $this->volume_gain_db; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setVolumeGainDb($var) - { - GPBUtil::checkDouble($var); - $this->volume_gain_db = $var; - - return $this; - } - - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return RepeatedField - */ - public function getEffectsProfileId() - { - return $this->effects_profile_id; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param string[] $var - * @return $this - */ - public function setEffectsProfileId($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->effects_profile_id = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php deleted file mode 100644 index f1840272c122..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.texttospeech.v1.AudioEncoding - */ -class AudioEncoding -{ - /** - * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return - * result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; - */ - const AUDIO_ENCODING_UNSPECIFIED = 0; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Audio content returned as LINEAR16 also contains a WAV header. - * - * Generated from protobuf enum LINEAR16 = 1; - */ - const LINEAR16 = 1; - /** - * MP3 audio at 32kbps. - * - * Generated from protobuf enum MP3 = 2; - */ - const MP3 = 2; - /** - * Opus encoded audio wrapped in an ogg container. The result is a - * file which can be played natively on Android, and in browsers (at least - * Chrome and Firefox). The quality of the encoding is considerably higher - * than MP3 while using approximately the same bitrate. - * - * Generated from protobuf enum OGG_OPUS = 3; - */ - const OGG_OPUS = 3; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - * Audio content returned as MULAW also contains a WAV header. - * - * Generated from protobuf enum MULAW = 5; - */ - const MULAW = 5; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - * Audio content returned as ALAW also contains a WAV header. - * - * Generated from protobuf enum ALAW = 6; - */ - const ALAW = 6; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or - * any other) header. - * - * Generated from protobuf enum PCM = 7; - */ - const PCM = 7; - /** - * M4A audio. - * - * Generated from protobuf enum M4A = 8; - */ - const M4A = 8; - - private static $valueToName = [ - self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', - self::LINEAR16 => 'LINEAR16', - self::MP3 => 'MP3', - self::OGG_OPUS => 'OGG_OPUS', - self::MULAW => 'MULAW', - self::ALAW => 'ALAW', - self::PCM => 'PCM', - self::M4A => 'M4A', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php deleted file mode 100644 index 2c5b30d8ee8c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams - */ -class CustomPronunciationParams extends \Google\Protobuf\Internal\Message -{ - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - */ - protected $phrase = null; - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - */ - protected $phonetic_encoding = null; - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - */ - protected $pronunciation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $phrase - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * @type int $phonetic_encoding - * The phonetic encoding of the phrase. - * @type string $pronunciation - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @return string - */ - public function getPhrase() - { - return isset($this->phrase) ? $this->phrase : ''; - } - - public function hasPhrase() - { - return isset($this->phrase); - } - - public function clearPhrase() - { - unset($this->phrase); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @param string $var - * @return $this - */ - public function setPhrase($var) - { - GPBUtil::checkString($var, True); - $this->phrase = $var; - - return $this; - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @return int - */ - public function getPhoneticEncoding() - { - return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; - } - - public function hasPhoneticEncoding() - { - return isset($this->phonetic_encoding); - } - - public function clearPhoneticEncoding() - { - unset($this->phonetic_encoding); - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @param int $var - * @return $this - */ - public function setPhoneticEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); - $this->phonetic_encoding = $var; - - return $this; - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @return string - */ - public function getPronunciation() - { - return isset($this->pronunciation) ? $this->pronunciation : ''; - } - - public function hasPronunciation() - { - return isset($this->pronunciation); - } - - public function clearPronunciation() - { - unset($this->pronunciation); - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @param string $var - * @return $this - */ - public function setPronunciation($var) - { - GPBUtil::checkString($var, True); - $this->pronunciation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php deleted file mode 100644 index c2402dce74e4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding - */ -class PhoneticEncoding -{ - /** - * Not specified. - * - * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; - */ - const PHONETIC_ENCODING_UNSPECIFIED = 0; - /** - * IPA, such as apple -> ˈæpəl. - * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - * - * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; - */ - const PHONETIC_ENCODING_IPA = 1; - /** - * X-SAMPA, such as apple -> "{p\@l". - * https://en.wikipedia.org/wiki/X-SAMPA - * - * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; - */ - const PHONETIC_ENCODING_X_SAMPA = 2; - /** - * For reading-to-pron conversion to work well, the `pronunciation` field - * should only contain Kanji, Hiragana, and Katakana. - * The pronunciation can also contain pitch accents. - * The start of a pitch phrase is specified with `^` and the down-pitch - * position is specified with `!`, for example: - * phrase:端 pronunciation:^はし - * phrase:箸 pronunciation:^は!し - * phrase:橋 pronunciation:^はし! - * We currently only support the Tokyo dialect, which allows at most one - * down-pitch per phrase (i.e. at most one `!` between `^`). - * - * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - */ - const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - /** - * Used to specify pronunciations for Mandarin words. See - * https://en.wikipedia.org/wiki/Pinyin. - * For example: 朝阳, the pronunciation is "chao2 yang2". The number - * represents the tone, and there is a space between syllables. Neutral - * tones are represented by 5, for example 孩子 "hai2 zi5". - * - * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; - */ - const PHONETIC_ENCODING_PINYIN = 4; - - private static $valueToName = [ - self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', - self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', - self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', - self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', - self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php deleted file mode 100644 index 624e775a9ee3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciations - */ -class CustomPronunciations extends \Google\Protobuf\Internal\Message -{ - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - */ - private $pronunciations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations - * The pronunciation customizations are applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> - */ - public function getPronunciations() - { - return $this->pronunciations; - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var - * @return $this - */ - public function setPronunciations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); - $this->pronunciations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php deleted file mode 100644 index f84c66d01a3a..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams - */ -class CustomVoiceParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $model = ''; - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $reported_usage = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $model - * Required. The name of the AutoML model that synthesizes the custom voice. - * @type int $reported_usage - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return int - * @deprecated - */ - public function getReportedUsage() - { - if ($this->reported_usage !== 0) { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - } - return $this->reported_usage; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - * @deprecated - */ - public function setReportedUsage($var) - { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); - $this->reported_usage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php deleted file mode 100644 index ecec1d4c0cc3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage - */ -class ReportedUsage -{ - /** - * Request with reported usage unspecified will be rejected. - * - * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; - */ - const REPORTED_USAGE_UNSPECIFIED = 0; - /** - * For scenarios where the synthesized audio is not downloadable and can - * only be used once. For example, real-time request in IVR system. - * - * Generated from protobuf enum REALTIME = 1; - */ - const REALTIME = 1; - /** - * For scenarios where the synthesized audio is downloadable and can be - * reused. For example, the synthesized audio is downloaded, stored in - * customer service system and played repeatedly. - * - * Generated from protobuf enum OFFLINE = 2; - */ - const OFFLINE = 2; - - private static $valueToName = [ - self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', - self::REALTIME => 'REALTIME', - self::OFFLINE => 'OFFLINE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php deleted file mode 100644 index 12a0e68e3f6b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesRequest - */ -class ListVoicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - - /** - * @param string $languageCode Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest - * - * @experimental - */ - public static function build(string $languageCode): self - { - return (new self()) - ->setLanguageCode($languageCode); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php deleted file mode 100644 index fa9403399bd4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesResponse - */ -class ListVoicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - */ - private $voices; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices - * The list of voices. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> - */ - public function getVoices() - { - return $this->voices; - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var - * @return $this - */ - public function setVoices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); - $this->voices = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php deleted file mode 100644 index f8f99a09a577..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup - */ -class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $turns; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns - * Required. Speaker turns. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> - */ - public function getTurns() - { - return $this->turns; - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var - * @return $this - */ - public function setTurns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); - $this->turns = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php deleted file mode 100644 index 2a23ef66e117..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn - */ -class Turn extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker = ''; - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $text = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * @type string $text - * Required. The text to speak. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeaker() - { - return $this->speaker; - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeaker($var) - { - GPBUtil::checkString($var, True); - $this->speaker = $var; - - return $this; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php deleted file mode 100644 index 8da52d2fb891..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig - */ -class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $speaker_voice_configs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> - */ - public function getSpeakerVoiceConfigs() - { - return $this->speaker_voice_configs; - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var - * @return $this - */ - public function setSpeakerVoiceConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); - $this->speaker_voice_configs = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php deleted file mode 100644 index 3b6efea63337..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice - */ -class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_alias = ''; - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker_alias - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * @type string $speaker_id - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerAlias() - { - return $this->speaker_alias; - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerAlias($var) - { - GPBUtil::checkString($var, True); - $this->speaker_alias = $var; - - return $this; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerId() - { - return $this->speaker_id; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerId($var) - { - GPBUtil::checkString($var, True); - $this->speaker_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php deleted file mode 100644 index ca9b5bfd29a5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.SsmlVoiceGender - */ -class SsmlVoiceGender -{ - /** - * An unspecified gender. - * In VoiceSelectionParams, this means that the client doesn't care which - * gender the selected voice will have. In the Voice field of - * ListVoicesResponse, this may mean that the voice doesn't fit any of the - * other categories in this enum, or that the gender of the voice isn't known. - * - * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; - */ - const SSML_VOICE_GENDER_UNSPECIFIED = 0; - /** - * A male voice. - * - * Generated from protobuf enum MALE = 1; - */ - const MALE = 1; - /** - * A female voice. - * - * Generated from protobuf enum FEMALE = 2; - */ - const FEMALE = 2; - /** - * A gender-neutral voice. This voice is not yet supported. - * - * Generated from protobuf enum NEUTRAL = 3; - */ - const NEUTRAL = 3; - - private static $valueToName = [ - self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', - self::MALE => 'MALE', - self::FEMALE => 'FEMALE', - self::NEUTRAL => 'NEUTRAL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php deleted file mode 100644 index 95dfe75a3cbd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.texttospeech.v1.StreamingAudioConfig - */ -class StreamingAudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * return an error. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php deleted file mode 100644 index 7e1176739a64..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesisInput - */ -class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * @type string $prompt - * This is system instruction supported only for controllable voice models. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(7); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(7); - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php deleted file mode 100644 index f41fcec24009..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php +++ /dev/null @@ -1,193 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeConfig - */ -class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $streaming_audio_config = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config - * Optional. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null - */ - public function getStreamingAudioConfig() - { - return $this->streaming_audio_config; - } - - public function hasStreamingAudioConfig() - { - return isset($this->streaming_audio_config); - } - - public function clearStreamingAudioConfig() - { - unset($this->streaming_audio_config); - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var - * @return $this - */ - public function setStreamingAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); - $this->streaming_audio_config = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php deleted file mode 100644 index 4f79a5b8ca0d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeRequest - */ -class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message -{ - protected $streaming_request; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null - */ - public function getStreamingConfig() - { - return $this->readOneof(1); - } - - public function hasStreamingConfig() - { - return $this->hasOneof(1); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var - * @return $this - */ - public function setStreamingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null - */ - public function getInput() - { - return $this->readOneof(2); - } - - public function hasInput() - { - return $this->hasOneof(2); - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getStreamingRequest() - { - return $this->whichOneof("streaming_request"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php deleted file mode 100644 index c817aee908d9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeResponse - */ -class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php deleted file mode 100644 index 192ac5065466..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php +++ /dev/null @@ -1,323 +0,0 @@ -google.cloud.texttospeech.v1.SynthesisInput - */ -class SynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. - * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * @type string $ssml - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * @type string $prompt - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @return string - */ - public function getSsml() - { - return $this->readOneof(2); - } - - public function hasSsml() - { - return $this->hasOneof(2); - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @param string $var - * @return $this - */ - public function setSsml($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(4); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(4); - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php deleted file mode 100644 index a7081c28ca1b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata - */ -class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @deprecated - */ - protected $last_update_time = null; - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - */ - protected $progress_percentage = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Time when the request was received. - * @type \Google\Protobuf\Timestamp $last_update_time - * Deprecated. Do not use. - * @type float $progress_percentage - * The progress of the most recent processing update in percentage, ie. 70.0%. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @return \Google\Protobuf\Timestamp|null - * @deprecated - */ - public function getLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return $this->last_update_time; - } - - public function hasLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return isset($this->last_update_time); - } - - public function clearLastUpdateTime() - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - unset($this->last_update_time); - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - * @deprecated - */ - public function setLastUpdateTime($var) - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_update_time = $var; - - return $this; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @return float - */ - public function getProgressPercentage() - { - return $this->progress_percentage; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @param float $var - * @return $this - */ - public function setProgressPercentage($var) - { - GPBUtil::checkDouble($var); - $this->progress_percentage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php deleted file mode 100644 index a53081392bfa..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php +++ /dev/null @@ -1,246 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioRequest - */ -class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - */ - protected $parent = ''; - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_gcs_uri = ''; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type string $output_gcs_uri - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getOutputGcsUri() - { - return $this->output_gcs_uri; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setOutputGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->output_gcs_uri = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php deleted file mode 100644 index e945932a1d90..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioResponse - */ -class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php deleted file mode 100644 index 79c547bc582b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php +++ /dev/null @@ -1,226 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechRequest - */ -class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; - */ - protected $advanced_voice_options = null; - - /** - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. - * - * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest - * - * @experimental - */ - public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self - { - return (new self()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Advanced voice options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php deleted file mode 100644 index 680f77554cac..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechResponse - */ -class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php deleted file mode 100644 index d1b762b4b09e..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.Voice - */ -class Voice extends \Google\Protobuf\Internal\Message -{ - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - */ - private $language_codes; - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - */ - protected $natural_sample_rate_hertz = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string[] $language_codes - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * @type string $name - * The name of this voice. Each distinct voice has a unique name. - * @type int $ssml_gender - * The gender of this voice. - * @type int $natural_sample_rate_hertz - * The natural sample rate (in hertz) for this voice. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @return RepeatedField - */ - public function getLanguageCodes() - { - return $this->language_codes; - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @param string[] $var - * @return $this - */ - public function setLanguageCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->language_codes = $arr; - - return $this; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @return int - */ - public function getNaturalSampleRateHertz() - { - return $this->natural_sample_rate_hertz; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @param int $var - * @return $this - */ - public function setNaturalSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->natural_sample_rate_hertz = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php deleted file mode 100644 index b16e4fb4438d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.VoiceCloneParams - */ -class VoiceCloneParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice_cloning_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $voice_cloning_key - * Required. Created by GenerateVoiceCloningKey. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVoiceCloningKey() - { - return $this->voice_cloning_key; - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVoiceCloningKey($var) - { - GPBUtil::checkString($var, True); - $this->voice_cloning_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php deleted file mode 100644 index 8168d4784067..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php +++ /dev/null @@ -1,393 +0,0 @@ -google.cloud.texttospeech.v1.VoiceSelectionParams - */ -class VoiceSelectionParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $language_code = ''; - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - */ - protected $custom_voice = null; - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $voice_clone = null; - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $model_name = ''; - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $multi_speaker_voice_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * @type string $name - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * @type int $ssml_gender - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * @type string $model_name - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null - */ - public function getCustomVoice() - { - return $this->custom_voice; - } - - public function hasCustomVoice() - { - return isset($this->custom_voice); - } - - public function clearCustomVoice() - { - unset($this->custom_voice); - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var - * @return $this - */ - public function setCustomVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); - $this->custom_voice = $var; - - return $this; - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null - */ - public function getVoiceClone() - { - return $this->voice_clone; - } - - public function hasVoiceClone() - { - return isset($this->voice_clone); - } - - public function clearVoiceClone() - { - unset($this->voice_clone); - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var - * @return $this - */ - public function setVoiceClone($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); - $this->voice_clone = $var; - - return $this; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getModelName() - { - return $this->model_name; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setModelName($var) - { - GPBUtil::checkString($var, True); - $this->model_name = $var; - - return $this; - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null - */ - public function getMultiSpeakerVoiceConfig() - { - return $this->multi_speaker_voice_config; - } - - public function hasMultiSpeakerVoiceConfig() - { - return isset($this->multi_speaker_voice_config); - } - - public function clearMultiSpeakerVoiceConfig() - { - unset($this->multi_speaker_voice_config); - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var - * @return $this - */ - public function setMultiSpeakerVoiceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); - $this->multi_speaker_voice_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php deleted file mode 100644 index 63287fc46efb..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php +++ /dev/null @@ -1,57 +0,0 @@ -listVoices($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php deleted file mode 100644 index 71c34862135f..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php +++ /dev/null @@ -1,64 +0,0 @@ -streamingSynthesize(); - $stream->writeAll([$request,]); - - /** @var StreamingSynthesizeResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php deleted file mode 100644 index b1cc1a69e31c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php +++ /dev/null @@ -1,94 +0,0 @@ -setLanguageCode($voiceLanguageCode); - $audioConfig = (new AudioConfig()) - ->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var SynthesizeSpeechResponse $response */ - $response = $textToSpeechClient->synthesizeSpeech($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $voiceLanguageCode = '[LANGUAGE_CODE]'; - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php deleted file mode 100644 index 0ba4a026bd4b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php +++ /dev/null @@ -1,89 +0,0 @@ -setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var SynthesizeLongAudioResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_long_audio_sample($audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php deleted file mode 100644 index 066691e4cffd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php +++ /dev/null @@ -1,308 +0,0 @@ - listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) - * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Returns a list of Voice supported for synthesis. - * - * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . - * - * @example samples/V1/TextToSpeechClient/list_voices.php - * - * @param ListVoicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ListVoicesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse - { - return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); - } - - /** - * Performs bidirectional streaming speech synthesis: receives audio while - * sending text. - * - * @example samples/V1/TextToSpeechClient/streaming_synthesize.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingSynthesize(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingSynthesize', null, $callOptions); - } - - /** - * Synthesizes speech synchronously: receive results after all text input - * has been processed. - * - * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . - * - * @example samples/V1/TextToSpeechClient/synthesize_speech.php - * - * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SynthesizeSpeechResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse - { - return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php deleted file mode 100644 index 56bf66fffe09..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php +++ /dev/null @@ -1,310 +0,0 @@ - synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechLongAudioSynthesizeClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = $this->descriptors[$methodName]['longRunning'] ?? []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Synthesizes long form text asynchronously. - * - * The async variant is - * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . - * - * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php - * - * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json deleted file mode 100644 index aef5b6710920..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechGapicClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "StreamingSynthesize": { - "methods": [ - "streamingSynthesize" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - } - } - }, - "TextToSpeechLongAudioSynthesize": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", - "rpcs": { - "SynthesizeLongAudio": { - "methods": [ - "synthesizeLongAudio" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json deleted file mode 100644 index 6aaa36720e99..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeech": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "StreamingSynthesize": { - "timeout_millis": 300000 - }, - "SynthesizeSpeech": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php deleted file mode 100644 index ad4d236b8015..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php +++ /dev/null @@ -1,46 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', - ], - 'StreamingSynthesize' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', - ], - 'SynthesizeSpeech' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json deleted file mode 100644 index 1f2cda4e7cf5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "SynthesizeLongAudio": { - "timeout_millis": 5000000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php deleted file mode 100644 index c2b2750ecd9d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php +++ /dev/null @@ -1,50 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', - 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php deleted file mode 100644 index 4887663a2925..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php +++ /dev/null @@ -1,65 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php deleted file mode 100644 index 6b0e6a003979..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/voices', - ], - 'SynthesizeSpeech' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/text:synthesize', - 'body' => '*', - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php deleted file mode 100644 index 86ed5387e74d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php +++ /dev/null @@ -1,325 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechClient($options); - } - - /** @test */ - public function listVoicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoices($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListVoicesRequest(); - try { - $gapicClient->listVoices($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new StreamingSynthesizeResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - $audioContent2 = '-61'; - $expectedResponse2 = new StreamingSynthesizeResponse(); - $expectedResponse2->setAudioContent($audioContent2); - $transport->addResponse($expectedResponse2); - $audioContent3 = '-60'; - $expectedResponse3 = new StreamingSynthesizeResponse(); - $expectedResponse3->setAudioContent($audioContent3); - $transport->addResponse($expectedResponse3); - // Mock request - $request = new StreamingSynthesizeRequest(); - $request2 = new StreamingSynthesizeRequest(); - $request3 = new StreamingSynthesizeRequest(); - $bidi = $gapicClient->streamingSynthesize(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingSynthesize(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new SynthesizeSpeechResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeSpeech($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); - $actualValue = $actualRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualRequestObject->getVoice(); - $this->assertProtobufEquals($voice, $actualValue); - $actualValue = $actualRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - try { - $gapicClient->synthesizeSpeech($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoicesAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php deleted file mode 100644 index 0e0de17a71d7..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php +++ /dev/null @@ -1,270 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechLongAudioSynthesizeClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechLongAudioSynthesizeClient($options); - } - - /** @test */ - public function synthesizeLongAudioTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} From 0323f1e6564fa7390c6ac776b1a4dcbb9a3cf70c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 06:31:47 +0000 Subject: [PATCH 5/6] feat: Support safety settings for Gemini voices and deprecate `relax_safety_filters` feat: Support `enable_textnorm` for Gemini voices. feat: Mark `advanced_voice_options` as optional. docs: A comment for field `relax_safety_filters` in message `.google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions` is changed docs: A comment for field `advanced_voice_options` in message `.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.SynthesisInput` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.StreamingSynthesisInput` is changed PiperOrigin-RevId: 892460024 Source-Link: https://github.com/googleapis/googleapis/commit/a481d8bc0fee68f046754610f91421841053f411 Source-Link: https://github.com/googleapis/googleapis-gen/commit/80347618c38e2e98e5a08fbcf255e6c5be205124 Copy-Tag: eyJwIjoiVGV4dFRvU3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiI4MDM0NzYxOGMzOGUyZTk4ZTVhMDhmYmNmMjU1ZTZjNWJlMjA1MTI0In0= --- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 ++ .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 ++ .../TextToSpeech/V1/AdvancedVoiceOptions.php | 230 ++++++++++ .../HarmBlockThreshold.php | 82 ++++ .../V1/AdvancedVoiceOptions/HarmCategory.php | 76 ++++ .../V1/AdvancedVoiceOptions/SafetySetting.php | 101 +++++ .../AdvancedVoiceOptions/SafetySettings.php | 67 +++ .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 +++++++++++++++ .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 +++++ .../V1/CustomPronunciationParams.php | 177 ++++++++ .../PhoneticEncoding.php | 90 ++++ .../TextToSpeech/V1/CustomPronunciations.php | 67 +++ .../TextToSpeech/V1/CustomVoiceParams.php | 108 +++++ .../V1/CustomVoiceParams/ReportedUsage.php | 65 +++ .../TextToSpeech/V1/ListVoicesRequest.php | 115 +++++ .../TextToSpeech/V1/ListVoicesResponse.php | 67 +++ .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 +++ .../V1/MultiSpeakerMarkup/Turn.php | 105 +++++ .../V1/MultiSpeakerVoiceConfig.php | 72 ++++ .../V1/MultispeakerPrebuiltVoice.php | 114 +++++ .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ++++ .../TextToSpeech/V1/StreamingAudioConfig.php | 155 +++++++ .../V1/StreamingSynthesisInput.php | 197 +++++++++ .../V1/StreamingSynthesizeConfig.php | 237 +++++++++++ .../V1/StreamingSynthesizeRequest.php | 118 ++++++ .../V1/StreamingSynthesizeResponse.php | 73 ++++ .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 ++++++++++++++ .../V1/SynthesizeLongAudioMetadata.php | 166 ++++++++ .../V1/SynthesizeLongAudioRequest.php | 246 +++++++++++ .../V1/SynthesizeLongAudioResponse.php | 33 ++ .../V1/SynthesizeSpeechRequest.php | 226 ++++++++++ .../V1/SynthesizeSpeechResponse.php | 83 ++++ .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 ++++++++ .../TextToSpeech/V1/VoiceCloneParams.php | 67 +++ .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ++++++++++++++++++ .../V1/TextToSpeechClient/list_voices.php | 57 +++ .../streaming_synthesize.php | 64 +++ .../TextToSpeechClient/synthesize_speech.php | 94 +++++ .../synthesize_long_audio.php | 89 ++++ .../v1/src/V1/Client/TextToSpeechClient.php | 308 ++++++++++++++ .../TextToSpeechLongAudioSynthesizeClient.php | 310 ++++++++++++++ .../v1/src/V1/gapic_metadata.json | 47 +++ .../text_to_speech_client_config.json | 58 +++ .../text_to_speech_descriptor_config.php | 46 ++ ...h_long_audio_synthesize_client_config.json | 37 ++ ...ong_audio_synthesize_descriptor_config.php | 50 +++ ...ng_audio_synthesize_rest_client_config.php | 65 +++ .../text_to_speech_rest_client_config.php | 62 +++ .../Unit/V1/Client/TextToSpeechClientTest.php | 325 +++++++++++++++ ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ++++++++++++ 50 files changed, 6546 insertions(+) create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php create mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php create mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php new file mode 100644 index 000000000000..09089fee21c9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php new file mode 100644 index 000000000000..78b5cfdb66d4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php new file mode 100644 index 000000000000..d30dc7f08739 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php @@ -0,0 +1,230 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions + */ +class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + */ + protected $low_latency_journey_synthesis = null; + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $relax_safety_filters = false; + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $safety_settings = null; + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_textnorm = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $low_latency_journey_synthesis + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * @type bool $relax_safety_filters + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * @type bool $enable_textnorm + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @return bool + */ + public function getLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; + } + + public function hasLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis); + } + + public function clearLowLatencyJourneySynthesis() + { + unset($this->low_latency_journey_synthesis); + } + + /** + * Only for Journey voices. If false, the synthesis is context aware + * and has a higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @param bool $var + * @return $this + */ + public function setLowLatencyJourneySynthesis($var) + { + GPBUtil::checkBool($var); + $this->low_latency_journey_synthesis = $var; + + return $this; + } + + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getRelaxSafetyFilters() + { + if ($this->relax_safety_filters !== false) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + } + return $this->relax_safety_filters; + } + + /** + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setRelaxSafetyFilters($var) + { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->relax_safety_filters = $var; + + return $this; + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null + */ + public function getSafetySettings() + { + return $this->safety_settings; + } + + public function hasSafetySettings() + { + return isset($this->safety_settings); + } + + public function clearSafetySettings() + { + unset($this->safety_settings); + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var + * @return $this + */ + public function setSafetySettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); + $this->safety_settings = $var; + + return $this; + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextnorm() + { + return isset($this->enable_textnorm) ? $this->enable_textnorm : false; + } + + public function hasEnableTextnorm() + { + return isset($this->enable_textnorm); + } + + public function clearEnableTextnorm() + { + unset($this->enable_textnorm); + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextnorm($var) + { + GPBUtil::checkBool($var); + $this->enable_textnorm = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php new file mode 100644 index 000000000000..c2c2a32aae59 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php @@ -0,0 +1,82 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold + */ +class HarmBlockThreshold +{ + /** + * The harm block threshold is unspecified. + * + * Generated from protobuf enum HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + */ + const HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + /** + * Block content with a low harm probability or higher. + * + * Generated from protobuf enum BLOCK_LOW_AND_ABOVE = 1; + */ + const BLOCK_LOW_AND_ABOVE = 1; + /** + * Block content with a medium harm probability or higher. + * + * Generated from protobuf enum BLOCK_MEDIUM_AND_ABOVE = 2; + */ + const BLOCK_MEDIUM_AND_ABOVE = 2; + /** + * Block content with a high harm probability. + * + * Generated from protobuf enum BLOCK_ONLY_HIGH = 3; + */ + const BLOCK_ONLY_HIGH = 3; + /** + * Do not block any content, regardless of its harm probability. + * + * Generated from protobuf enum BLOCK_NONE = 4; + */ + const BLOCK_NONE = 4; + /** + * Turn off the safety filter entirely. + * + * Generated from protobuf enum OFF = 5; + */ + const OFF = 5; + + private static $valueToName = [ + self::HARM_BLOCK_THRESHOLD_UNSPECIFIED => 'HARM_BLOCK_THRESHOLD_UNSPECIFIED', + self::BLOCK_LOW_AND_ABOVE => 'BLOCK_LOW_AND_ABOVE', + self::BLOCK_MEDIUM_AND_ABOVE => 'BLOCK_MEDIUM_AND_ABOVE', + self::BLOCK_ONLY_HIGH => 'BLOCK_ONLY_HIGH', + self::BLOCK_NONE => 'BLOCK_NONE', + self::OFF => 'OFF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php new file mode 100644 index 000000000000..cf4329b14f5e --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php @@ -0,0 +1,76 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory + */ +class HarmCategory +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum HARM_CATEGORY_UNSPECIFIED = 0; + */ + const HARM_CATEGORY_UNSPECIFIED = 0; + /** + * Content that promotes violence or incites hatred against individuals or + * groups based on certain attributes. + * + * Generated from protobuf enum HARM_CATEGORY_HATE_SPEECH = 1; + */ + const HARM_CATEGORY_HATE_SPEECH = 1; + /** + * Content that promotes, facilitates, or enables dangerous activities. + * + * Generated from protobuf enum HARM_CATEGORY_DANGEROUS_CONTENT = 2; + */ + const HARM_CATEGORY_DANGEROUS_CONTENT = 2; + /** + * Abusive, threatening, or content intended to bully, torment, or ridicule. + * + * Generated from protobuf enum HARM_CATEGORY_HARASSMENT = 3; + */ + const HARM_CATEGORY_HARASSMENT = 3; + /** + * Content that contains sexually explicit material. + * + * Generated from protobuf enum HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + */ + const HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + + private static $valueToName = [ + self::HARM_CATEGORY_UNSPECIFIED => 'HARM_CATEGORY_UNSPECIFIED', + self::HARM_CATEGORY_HATE_SPEECH => 'HARM_CATEGORY_HATE_SPEECH', + self::HARM_CATEGORY_DANGEROUS_CONTENT => 'HARM_CATEGORY_DANGEROUS_CONTENT', + self::HARM_CATEGORY_HARASSMENT => 'HARM_CATEGORY_HARASSMENT', + self::HARM_CATEGORY_SEXUALLY_EXPLICIT => 'HARM_CATEGORY_SEXUALLY_EXPLICIT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php new file mode 100644 index 000000000000..7a43b6d3e35c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php @@ -0,0 +1,101 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting + */ +class SafetySetting extends \Google\Protobuf\Internal\Message +{ + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + */ + protected $category = 0; + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + */ + protected $threshold = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $category + * The harm category to apply the safety setting to. + * @type int $threshold + * The harm block threshold for the safety setting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * The harm category to apply the safety setting to. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmCategory::class); + $this->category = $var; + + return $this; + } + + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + * @return int + */ + public function getThreshold() + { + return $this->threshold; + } + + /** + * The harm block threshold for the safety setting. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; + * @param int $var + * @return $this + */ + public function setThreshold($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmBlockThreshold::class); + $this->threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php new file mode 100644 index 000000000000..8fedf168ccfd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings + */ +class SafetySettings extends \Google\Protobuf\Internal\Message +{ + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + */ + private $settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $settings + * The safety settings for the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting> + */ + public function getSettings() + { + return $this->settings; + } + + /** + * The safety settings for the request. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $var + * @return $this + */ + public function setSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting::class); + $this->settings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php new file mode 100644 index 000000000000..e490622773f8 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php @@ -0,0 +1,329 @@ +google.cloud.texttospeech.v1.AudioConfig + */ +class AudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * @type float $pitch + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * @type float $volume_gain_db + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * @type string[] $effects_profile_id + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * + * 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. + * + * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + * increase 20 semitones from the original pitch. -20 means decrease 20 + * semitones from the original pitch. + * + * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Input only. Volume gain (in dB) of the normal native volume + * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + * set to a value of 0.0 (dB), will play at normal native signal amplitude. A + * value of -6.0 (dB) will play at approximately half the amplitude of the + * normal native signal amplitude. A value of +6.0 (dB) will play at + * approximately twice the amplitude of the normal native signal amplitude. + * Strongly recommend not to exceed +10 (dB) as there's usually no effective + * increase in loudness for any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is + * specified in SynthesizeSpeechRequest, if this is different from the voice's + * natural sample rate, then the synthesizer will honor this request by + * converting to the desired sample rate (which might result in worse audio + * quality), unless the specified sample rate is not supported for the + * encoding chosen, in which case it will fail the request and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEffectsProfileId() + { + return $this->effects_profile_id; + } + + /** + * Optional. Input only. An identifier which selects 'audio effects' profiles + * that are applied on (post synthesized) text to speech. Effects are applied + * on top of each other in the order they are given. See + * [audio + * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + * current supported profile ids. + * + * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEffectsProfileId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effects_profile_id = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php new file mode 100644 index 000000000000..f1840272c122 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php @@ -0,0 +1,107 @@ +google.cloud.texttospeech.v1.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return + * result + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum LINEAR16 = 1; + */ + const LINEAR16 = 1; + /** + * MP3 audio at 32kbps. + * + * Generated from protobuf enum MP3 = 2; + */ + const MP3 = 2; + /** + * Opus encoded audio wrapped in an ogg container. The result is a + * file which can be played natively on Android, and in browsers (at least + * Chrome and Firefox). The quality of the encoding is considerably higher + * than MP3 while using approximately the same bitrate. + * + * Generated from protobuf enum OGG_OPUS = 3; + */ + const OGG_OPUS = 3; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * Audio content returned as MULAW also contains a WAV header. + * + * Generated from protobuf enum MULAW = 5; + */ + const MULAW = 5; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + * Audio content returned as ALAW also contains a WAV header. + * + * Generated from protobuf enum ALAW = 6; + */ + const ALAW = 6; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or + * any other) header. + * + * Generated from protobuf enum PCM = 7; + */ + const PCM = 7; + /** + * M4A audio. + * + * Generated from protobuf enum M4A = 8; + */ + const M4A = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::LINEAR16 => 'LINEAR16', + self::MP3 => 'MP3', + self::OGG_OPUS => 'OGG_OPUS', + self::MULAW => 'MULAW', + self::ALAW => 'ALAW', + self::PCM => 'PCM', + self::M4A => 'M4A', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php new file mode 100644 index 000000000000..2c5b30d8ee8c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams + */ +class CustomPronunciationParams extends \Google\Protobuf\Internal\Message +{ + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + */ + protected $phrase = null; + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + */ + protected $phonetic_encoding = null; + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + */ + protected $pronunciation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $phrase + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * @type int $phonetic_encoding + * The phonetic encoding of the phrase. + * @type string $pronunciation + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @return string + */ + public function getPhrase() + { + return isset($this->phrase) ? $this->phrase : ''; + } + + public function hasPhrase() + { + return isset($this->phrase); + } + + public function clearPhrase() + { + unset($this->phrase); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @param string $var + * @return $this + */ + public function setPhrase($var) + { + GPBUtil::checkString($var, True); + $this->phrase = $var; + + return $this; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @return int + */ + public function getPhoneticEncoding() + { + return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; + } + + public function hasPhoneticEncoding() + { + return isset($this->phonetic_encoding); + } + + public function clearPhoneticEncoding() + { + unset($this->phonetic_encoding); + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @param int $var + * @return $this + */ + public function setPhoneticEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); + $this->phonetic_encoding = $var; + + return $this; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @return string + */ + public function getPronunciation() + { + return isset($this->pronunciation) ? $this->pronunciation : ''; + } + + public function hasPronunciation() + { + return isset($this->pronunciation); + } + + public function clearPronunciation() + { + unset($this->pronunciation); + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @param string $var + * @return $this + */ + public function setPronunciation($var) + { + GPBUtil::checkString($var, True); + $this->pronunciation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php new file mode 100644 index 000000000000..c2402dce74e4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php @@ -0,0 +1,90 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding + */ +class PhoneticEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; + */ + const PHONETIC_ENCODING_UNSPECIFIED = 0; + /** + * IPA, such as apple -> ˈæpəl. + * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + * + * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; + */ + const PHONETIC_ENCODING_IPA = 1; + /** + * X-SAMPA, such as apple -> "{p\@l". + * https://en.wikipedia.org/wiki/X-SAMPA + * + * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; + */ + const PHONETIC_ENCODING_X_SAMPA = 2; + /** + * For reading-to-pron conversion to work well, the `pronunciation` field + * should only contain Kanji, Hiragana, and Katakana. + * The pronunciation can also contain pitch accents. + * The start of a pitch phrase is specified with `^` and the down-pitch + * position is specified with `!`, for example: + * phrase:端 pronunciation:^はし + * phrase:箸 pronunciation:^は!し + * phrase:橋 pronunciation:^はし! + * We currently only support the Tokyo dialect, which allows at most one + * down-pitch per phrase (i.e. at most one `!` between `^`). + * + * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + */ + const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; + /** + * Used to specify pronunciations for Mandarin words. See + * https://en.wikipedia.org/wiki/Pinyin. + * For example: 朝阳, the pronunciation is "chao2 yang2". The number + * represents the tone, and there is a space between syllables. Neutral + * tones are represented by 5, for example 孩子 "hai2 zi5". + * + * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; + */ + const PHONETIC_ENCODING_PINYIN = 4; + + private static $valueToName = [ + self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', + self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', + self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', + self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', + self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php new file mode 100644 index 000000000000..624e775a9ee3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.CustomPronunciations + */ +class CustomPronunciations extends \Google\Protobuf\Internal\Message +{ + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + */ + private $pronunciations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations + * The pronunciation customizations are applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> + */ + public function getPronunciations() + { + return $this->pronunciations; + } + + /** + * The pronunciation customizations are applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var + * @return $this + */ + public function setPronunciations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); + $this->pronunciations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php new file mode 100644 index 000000000000..f84c66d01a3a --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php @@ -0,0 +1,108 @@ +google.cloud.texttospeech.v1.CustomVoiceParams + */ +class CustomVoiceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $model = ''; + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $reported_usage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Required. The name of the AutoML model that synthesizes the custom voice. + * @type int $reported_usage + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Required. The name of the AutoML model that synthesizes the custom voice. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return int + * @deprecated + */ + public function getReportedUsage() + { + if ($this->reported_usage !== 0) { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + } + return $this->reported_usage; + } + + /** + * Optional. Deprecated. The usage of the synthesized audio to be reported. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + * @deprecated + */ + public function setReportedUsage($var) + { + @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); + $this->reported_usage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php new file mode 100644 index 000000000000..ecec1d4c0cc3 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php @@ -0,0 +1,65 @@ +google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage + */ +class ReportedUsage +{ + /** + * Request with reported usage unspecified will be rejected. + * + * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; + */ + const REPORTED_USAGE_UNSPECIFIED = 0; + /** + * For scenarios where the synthesized audio is not downloadable and can + * only be used once. For example, real-time request in IVR system. + * + * Generated from protobuf enum REALTIME = 1; + */ + const REALTIME = 1; + /** + * For scenarios where the synthesized audio is downloadable and can be + * reused. For example, the synthesized audio is downloaded, stored in + * customer service system and played repeatedly. + * + * Generated from protobuf enum OFFLINE = 2; + */ + const OFFLINE = 2; + + private static $valueToName = [ + self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', + self::REALTIME => 'REALTIME', + self::OFFLINE => 'OFFLINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php new file mode 100644 index 000000000000..12a0e68e3f6b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php @@ -0,0 +1,115 @@ +google.cloud.texttospeech.v1.ListVoicesRequest + */ +class ListVoicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $languageCode Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest + * + * @experimental + */ + public static function build(string $languageCode): self + { + return (new self()) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * If not specified, the API will return all supported voices. + * If specified, the ListVoices call will only return voices that can be used + * to synthesize this language_code. For example, if you specify `"en-NZ"`, + * all `"en-NZ"` voices will be returned. If you specify `"no"`, both + * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + * returned. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php new file mode 100644 index 000000000000..fa9403399bd4 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.ListVoicesResponse + */ +class ListVoicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + */ + private $voices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices + * The list of voices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> + */ + public function getVoices() + { + return $this->voices; + } + + /** + * The list of voices. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; + * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var + * @return $this + */ + public function setVoices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); + $this->voices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php new file mode 100644 index 000000000000..f8f99a09a577 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup + */ +class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $turns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns + * Required. Speaker turns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> + */ + public function getTurns() + { + return $this->turns; + } + + /** + * Required. Speaker turns. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var + * @return $this + */ + public function setTurns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); + $this->turns = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php new file mode 100644 index 000000000000..2a23ef66e117 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php @@ -0,0 +1,105 @@ +google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + */ +class Turn extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker = ''; + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * @type string $text + * Required. The text to speak. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeaker() + { + return $this->speaker; + } + + /** + * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + * to documentation for available speakers. + * + * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeaker($var) + { + GPBUtil::checkString($var, True); + $this->speaker = $var; + + return $this; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The text to speak. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php new file mode 100644 index 000000000000..8da52d2fb891 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php @@ -0,0 +1,72 @@ +google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig + */ +class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $speaker_voice_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> + */ + public function getSpeakerVoiceConfigs() + { + return $this->speaker_voice_configs; + } + + /** + * Required. A list of configurations for the voices of the speakers. Exactly + * two speaker voice configurations must be provided. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var + * @return $this + */ + public function setSpeakerVoiceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); + $this->speaker_voice_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php new file mode 100644 index 000000000000..3b6efea63337 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php @@ -0,0 +1,114 @@ +google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice + */ +class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_alias = ''; + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $speaker_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $speaker_alias + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * @type string $speaker_id + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerAlias() + { + return $this->speaker_alias; + } + + /** + * Required. The speaker alias of the voice. This is the user-chosen speaker + * name that is used in the multispeaker text input, such as "Speaker1". + * + * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerAlias($var) + { + GPBUtil::checkString($var, True); + $this->speaker_alias = $var; + + return $this; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSpeakerId() + { + return $this->speaker_id; + } + + /** + * Required. The speaker ID of the voice. See + * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + * for available values. + * + * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSpeakerId($var) + { + GPBUtil::checkString($var, True); + $this->speaker_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php new file mode 100644 index 000000000000..ca9b5bfd29a5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.SsmlVoiceGender + */ +class SsmlVoiceGender +{ + /** + * An unspecified gender. + * In VoiceSelectionParams, this means that the client doesn't care which + * gender the selected voice will have. In the Voice field of + * ListVoicesResponse, this may mean that the voice doesn't fit any of the + * other categories in this enum, or that the gender of the voice isn't known. + * + * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + const SSML_VOICE_GENDER_UNSPECIFIED = 0; + /** + * A male voice. + * + * Generated from protobuf enum MALE = 1; + */ + const MALE = 1; + /** + * A female voice. + * + * Generated from protobuf enum FEMALE = 2; + */ + const FEMALE = 2; + /** + * A gender-neutral voice. This voice is not yet supported. + * + * Generated from protobuf enum NEUTRAL = 3; + */ + const NEUTRAL = 3; + + private static $valueToName = [ + self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', + self::MALE => 'MALE', + self::FEMALE => 'FEMALE', + self::NEUTRAL => 'NEUTRAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php new file mode 100644 index 000000000000..95dfe75a3cbd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php @@ -0,0 +1,155 @@ +google.cloud.texttospeech.v1.StreamingAudioConfig + */ +class StreamingAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * return an error. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. + * @type float $speaking_rate + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format of the audio byte stream. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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. + * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + * 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; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + * the normal native speed supported by the specific voice. 2.0 is twice as + * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + * speed. Any other values < 0.25 or > 2.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php new file mode 100644 index 000000000000..49624284bec9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php @@ -0,0 +1,197 @@ +google.cloud.texttospeech.v1.StreamingSynthesisInput + */ +class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * @type string $markup + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * @type string $prompt + * This is system instruction supported only for controllable voice models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. It is recommended that each input + * contains complete, terminating sentences, which results in better prosody + * in the output audio. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(7); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(7); + } + + /** + * Multi-speaker markup for Gemini TTS. This field may not + * be used with any other voices. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This is system instruction supported only for controllable voice models. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php new file mode 100644 index 000000000000..d81c076523d6 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php @@ -0,0 +1,237 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeConfig + */ +class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $streaming_audio_config = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config + * Optional. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null + */ + public function getStreamingAudioConfig() + { + return $this->streaming_audio_config; + } + + public function hasStreamingAudioConfig() + { + return isset($this->streaming_audio_config); + } + + public function clearStreamingAudioConfig() + { + unset($this->streaming_audio_config); + } + + /** + * Optional. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var + * @return $this + */ + public function setStreamingAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); + $this->streaming_audio_config = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php new file mode 100644 index 000000000000..4f79a5b8ca0d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php @@ -0,0 +1,118 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeRequest + */ +class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message +{ + protected $streaming_request; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null + */ + public function getStreamingConfig() + { + return $this->readOneof(1); + } + + public function hasStreamingConfig() + { + return $this->hasOneof(1); + } + + /** + * StreamingSynthesizeConfig to be used in this streaming attempt. Only + * specified in the first message sent in a `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var + * @return $this + */ + public function setStreamingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null + */ + public function getInput() + { + return $this->readOneof(2); + } + + public function hasInput() + { + return $this->hasOneof(2); + } + + /** + * Input to synthesize. Specified in all messages but the first in a + * `StreamingSynthesize` call. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; + * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getStreamingRequest() + { + return $this->whichOneof("streaming_request"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php new file mode 100644 index 000000000000..c817aee908d9 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php @@ -0,0 +1,73 @@ +google.cloud.texttospeech.v1.StreamingSynthesizeResponse + */ +class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request. This is + * headerless LINEAR16 audio with a sample rate of 24000. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php new file mode 100644 index 000000000000..45bae6a448ea --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php @@ -0,0 +1,323 @@ +google.cloud.texttospeech.v1.SynthesisInput + */ +class SynthesisInput extends \Google\Protobuf\Internal\Message +{ + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + */ + protected $prompt = null; + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_pronunciations = null; + protected $input_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The raw text to be synthesized. + * @type string $markup + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * @type string $ssml + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * @type string $prompt + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The raw text to be synthesized. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @return string + */ + public function getMarkup() + { + return $this->readOneof(5); + } + + public function hasMarkup() + { + return $this->hasOneof(5); + } + + /** + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. + * + * Generated from protobuf field string markup = 5; + * @param string $var + * @return $this + */ + public function setMarkup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @return string + */ + public function getSsml() + { + return $this->readOneof(2); + } + + public function hasSsml() + { + return $this->hasOneof(2); + } + + /** + * The SSML document to be synthesized. The SSML document must be valid + * and well-formed. Otherwise the RPC will fail and return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + * more information, see + * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * + * Generated from protobuf field string ssml = 2; + * @param string $var + * @return $this + */ + public function setSsml($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null + */ + public function getMultiSpeakerMarkup() + { + return $this->readOneof(4); + } + + public function hasMultiSpeakerMarkup() + { + return $this->hasOneof(4); + } + + /** + * The multi-speaker input to be synthesized. Only applicable for + * multi-speaker synthesis. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var + * @return $this + */ + public function setMultiSpeakerMarkup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @return string + */ + public function getPrompt() + { + return isset($this->prompt) ? $this->prompt : ''; + } + + public function hasPrompt() + { + return isset($this->prompt); + } + + public function clearPrompt() + { + unset($this->prompt); + } + + /** + * This system instruction is supported only for controllable/promptable voice + * models. If this system instruction is used, we pass the unedited text to + * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + * calls this system instruction, Style Instructions. + * + * Generated from protobuf field optional string prompt = 6; + * @param string $var + * @return $this + */ + public function setPrompt($var) + { + GPBUtil::checkString($var, True); + $this->prompt = $var; + + return $this; + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations are applied to the input. If + * this is set, the input is synthesized using the given pronunciation + * customizations. + * The initial support is for en-us, with plans to expand to other locales in + * the future. Instant Clone voices aren't supported. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputSource() + { + return $this->whichOneof("input_source"); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php new file mode 100644 index 000000000000..a7081c28ca1b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php @@ -0,0 +1,166 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata + */ +class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @deprecated + */ + protected $last_update_time = null; + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + */ + protected $progress_percentage = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * @type \Google\Protobuf\Timestamp $last_update_time + * Deprecated. Do not use. + * @type float $progress_percentage + * The progress of the most recent processing update in percentage, ie. 70.0%. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + if (isset($this->last_update_time)) { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + } + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + unset($this->last_update_time); + } + + /** + * Deprecated. Do not use. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setLastUpdateTime($var) + { + @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @return float + */ + public function getProgressPercentage() + { + return $this->progress_percentage; + } + + /** + * The progress of the most recent processing update in percentage, ie. 70.0%. + * + * Generated from protobuf field double progress_percentage = 3; + * @param float $var + * @return $this + */ + public function setProgressPercentage($var) + { + GPBUtil::checkDouble($var); + $this->progress_percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php new file mode 100644 index 000000000000..a53081392bfa --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php @@ -0,0 +1,246 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioRequest + */ +class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_gcs_uri = ''; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type string $output_gcs_uri + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The resource states of the request in the form of + * `projects/{@*}locations/*`. + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputGcsUri() + { + return $this->output_gcs_uri; + } + + /** + * Required. Specifies a Cloud Storage URI for the synthesis results. Must be + * specified in the format: `gs://bucket_name/object_name`, and the bucket + * must already exist. + * + * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputGcsUri($var) + { + GPBUtil::checkString($var, True); + $this->output_gcs_uri = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php new file mode 100644 index 000000000000..e945932a1d90 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php @@ -0,0 +1,33 @@ +google.cloud.texttospeech.v1.SynthesizeLongAudioResponse + */ +class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php new file mode 100644 index 000000000000..2bb1c38b3c20 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php @@ -0,0 +1,226 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechRequest + */ +class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input = null; + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice = null; + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_config = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; + + /** + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. + * + * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest + * + * @experimental + */ + public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self + { + return (new self()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input + * Required. The Synthesizer requires either plain text or SSML as input. + * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice + * Required. The desired voice of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config + * Required. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * Required. The Synthesizer requires either plain text or SSML as input. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); + $this->input = $var; + + return $this; + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Required. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null + */ + public function getAudioConfig() + { + return $this->audio_config; + } + + public function hasAudioConfig() + { + return isset($this->audio_config); + } + + public function clearAudioConfig() + { + unset($this->audio_config); + } + + /** + * Required. The configuration of the synthesized audio. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); + $this->audio_config = $var; + + return $this; + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php new file mode 100644 index 000000000000..680f77554cac --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php @@ -0,0 +1,83 @@ +google.cloud.texttospeech.v1.SynthesizeSpeechResponse + */ +class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + */ + protected $audio_content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audio_content + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @return string + */ + public function getAudioContent() + { + return $this->audio_content; + } + + /** + * The audio data bytes encoded as specified in the request, including the + * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + * For LINEAR16 audio, we include the WAV header. Note: as + * with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + * + * Generated from protobuf field bytes audio_content = 1; + * @param string $var + * @return $this + */ + public function setAudioContent($var) + { + GPBUtil::checkString($var, False); + $this->audio_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php new file mode 100644 index 000000000000..d1b762b4b09e --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.Voice + */ +class Voice extends \Google\Protobuf\Internal\Message +{ + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + */ + private $language_codes; + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + */ + protected $natural_sample_rate_hertz = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $language_codes + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * @type string $name + * The name of this voice. Each distinct voice has a unique name. + * @type int $ssml_gender + * The gender of this voice. + * @type int $natural_sample_rate_hertz + * The natural sample rate (in hertz) for this voice. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @return RepeatedField + */ + public function getLanguageCodes() + { + return $this->language_codes; + } + + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + * "en-US", "es-419", "cmn-tw"). + * + * Generated from protobuf field repeated string language_codes = 1; + * @param string[] $var + * @return $this + */ + public function setLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_codes = $arr; + + return $this; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of this voice. Each distinct voice has a unique name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The gender of this voice. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @return int + */ + public function getNaturalSampleRateHertz() + { + return $this->natural_sample_rate_hertz; + } + + /** + * The natural sample rate (in hertz) for this voice. + * + * Generated from protobuf field int32 natural_sample_rate_hertz = 4; + * @param int $var + * @return $this + */ + public function setNaturalSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->natural_sample_rate_hertz = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php new file mode 100644 index 000000000000..b16e4fb4438d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.VoiceCloneParams + */ +class VoiceCloneParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voice_cloning_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $voice_cloning_key + * Required. Created by GenerateVoiceCloningKey. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVoiceCloningKey() + { + return $this->voice_cloning_key; + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVoiceCloningKey($var) + { + GPBUtil::checkString($var, True); + $this->voice_cloning_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php new file mode 100644 index 000000000000..8168d4784067 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php @@ -0,0 +1,393 @@ +google.cloud.texttospeech.v1.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + */ + protected $ssml_gender = 0; + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + */ + protected $custom_voice = null; + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice_clone = null; + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_name = ''; + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $multi_speaker_voice_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * @type string $name + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * @type int $ssml_gender + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * @type string $model_name + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language (and potentially also the region) of the voice + * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag, e.g. "en-US". This should not include a script tag (e.g. use + * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + * from the input provided in the SynthesisInput. The TTS service + * will use this parameter to help choose an appropriate voice. Note that + * the TTS service may choose a voice with a slightly different language code + * than the one selected; it may substitute a different region + * (e.g. using en-US rather than en-CA if there isn't a Canadian voice + * available), or even a different language, e.g. using "nb" (Norwegian + * Bokmal) instead of "no" (Norwegian)". + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the voice. If both the name and the gender are not set, + * the service will choose a voice based on the other parameters such as + * language_code. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a + * voice of the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null + */ + public function getCustomVoice() + { + return $this->custom_voice; + } + + public function hasCustomVoice() + { + return isset($this->custom_voice); + } + + public function clearCustomVoice() + { + unset($this->custom_voice); + } + + /** + * The configuration for a custom voice. If [CustomVoiceParams.model] is set, + * the service will choose the custom voice matching the specified + * configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; + * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var + * @return $this + */ + public function setCustomVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); + $this->custom_voice = $var; + + return $this; + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null + */ + public function getVoiceClone() + { + return $this->voice_clone; + } + + public function hasVoiceClone() + { + return isset($this->voice_clone); + } + + public function clearVoiceClone() + { + unset($this->voice_clone); + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + * clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var + * @return $this + */ + public function setVoiceClone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); + $this->voice_clone = $var; + + return $this; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelName() + { + return $this->model_name; + } + + /** + * Optional. The name of the model. If set, the service will choose the model + * matching the specified configuration. + * + * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelName($var) + { + GPBUtil::checkString($var, True); + $this->model_name = $var; + + return $this; + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null + */ + public function getMultiSpeakerVoiceConfig() + { + return $this->multi_speaker_voice_config; + } + + public function hasMultiSpeakerVoiceConfig() + { + return isset($this->multi_speaker_voice_config); + } + + public function clearMultiSpeakerVoiceConfig() + { + unset($this->multi_speaker_voice_config); + } + + /** + * Optional. The configuration for a Gemini multi-speaker text-to-speech + * setup. Enables the use of two distinct voices in a single synthesis + * request. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var + * @return $this + */ + public function setMultiSpeakerVoiceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); + $this->multi_speaker_voice_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php new file mode 100644 index 000000000000..63287fc46efb --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php @@ -0,0 +1,57 @@ +listVoices($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php new file mode 100644 index 000000000000..71c34862135f --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php @@ -0,0 +1,64 @@ +streamingSynthesize(); + $stream->writeAll([$request,]); + + /** @var StreamingSynthesizeResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php new file mode 100644 index 000000000000..b1cc1a69e31c --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php @@ -0,0 +1,94 @@ +setLanguageCode($voiceLanguageCode); + $audioConfig = (new AudioConfig()) + ->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var SynthesizeSpeechResponse $response */ + $response = $textToSpeechClient->synthesizeSpeech($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $voiceLanguageCode = '[LANGUAGE_CODE]'; + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php new file mode 100644 index 000000000000..0ba4a026bd4b --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php @@ -0,0 +1,89 @@ +setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SynthesizeLongAudioResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + + synthesize_long_audio_sample($audioConfigAudioEncoding); +} +// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php new file mode 100644 index 000000000000..066691e4cffd --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php @@ -0,0 +1,308 @@ + listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns a list of Voice supported for synthesis. + * + * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . + * + * @example samples/V1/TextToSpeechClient/list_voices.php + * + * @param ListVoicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListVoicesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse + { + return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); + } + + /** + * Performs bidirectional streaming speech synthesis: receives audio while + * sending text. + * + * @example samples/V1/TextToSpeechClient/streaming_synthesize.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingSynthesize(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingSynthesize', null, $callOptions); + } + + /** + * Synthesizes speech synchronously: receive results after all text input + * has been processed. + * + * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . + * + * @example samples/V1/TextToSpeechClient/synthesize_speech.php + * + * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SynthesizeSpeechResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse + { + return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php new file mode 100644 index 000000000000..56bf66fffe09 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php @@ -0,0 +1,310 @@ + synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) + */ +final class TextToSpeechLongAudioSynthesizeClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'texttospeech.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Synthesizes long form text asynchronously. + * + * The async variant is + * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . + * + * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php + * + * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..aef5b6710920 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechGapicClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "StreamingSynthesize": { + "methods": [ + "streamingSynthesize" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + } + } + }, + "TextToSpeechLongAudioSynthesize": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", + "rpcs": { + "SynthesizeLongAudio": { + "methods": [ + "synthesizeLongAudio" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json new file mode 100644 index 000000000000..6aaa36720e99 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeech": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "ListVoices": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamingSynthesize": { + "timeout_millis": 300000 + }, + "SynthesizeSpeech": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php new file mode 100644 index 000000000000..ad4d236b8015 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php @@ -0,0 +1,46 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', + ], + 'StreamingSynthesize' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', + ], + 'SynthesizeSpeech' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json new file mode 100644 index 000000000000..1f2cda4e7cf5 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000000, + "total_timeout_millis": 5000000 + } + }, + "methods": { + "SynthesizeLongAudio": { + "timeout_millis": 5000000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php new file mode 100644 index 000000000000..c2b2750ecd9d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', + 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php new file mode 100644 index 000000000000..4887663a2925 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php @@ -0,0 +1,65 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ + 'SynthesizeLongAudio' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php new file mode 100644 index 000000000000..6b0e6a003979 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.texttospeech.v1.TextToSpeech' => [ + 'ListVoices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/voices', + ], + 'SynthesizeSpeech' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/text:synthesize', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php new file mode 100644 index 000000000000..86ed5387e74d --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php @@ -0,0 +1,325 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechClient($options); + } + + /** @test */ + public function listVoicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoices($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListVoicesRequest(); + try { + $gapicClient->listVoices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new StreamingSynthesizeResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + $audioContent2 = '-61'; + $expectedResponse2 = new StreamingSynthesizeResponse(); + $expectedResponse2->setAudioContent($audioContent2); + $transport->addResponse($expectedResponse2); + $audioContent3 = '-60'; + $expectedResponse3 = new StreamingSynthesizeResponse(); + $expectedResponse3->setAudioContent($audioContent3); + $transport->addResponse($expectedResponse3); + // Mock request + $request = new StreamingSynthesizeRequest(); + $request2 = new StreamingSynthesizeRequest(); + $request3 = new StreamingSynthesizeRequest(); + $bidi = $gapicClient->streamingSynthesize(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingSynthesizeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingSynthesize(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audioContent = '16'; + $expectedResponse = new SynthesizeSpeechResponse(); + $expectedResponse->setAudioContent($audioContent); + $transport->addResponse($expectedResponse); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeSpeech($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); + $actualValue = $actualRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualRequestObject->getVoice(); + $this->assertProtobufEquals($voice, $actualValue); + $actualValue = $actualRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function synthesizeSpeechExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $voice = new VoiceSelectionParams(); + $voiceLanguageCode = 'voiceLanguageCode-686472265'; + $voice->setLanguageCode($voiceLanguageCode); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeSpeechRequest()) + ->setInput($input) + ->setVoice($voice) + ->setAudioConfig($audioConfig); + try { + $gapicClient->synthesizeSpeech($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVoicesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListVoicesResponse(); + $transport->addResponse($expectedResponse); + $request = new ListVoicesRequest(); + $response = $gapicClient->listVoicesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php new file mode 100644 index 000000000000..0e0de17a71d7 --- /dev/null +++ b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php @@ -0,0 +1,270 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TextToSpeechLongAudioSynthesizeClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TextToSpeechLongAudioSynthesizeClient($options); + } + + /** @test */ + public function synthesizeLongAudioTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudio($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function synthesizeLongAudioAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/synthesizeLongAudioTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SynthesizeLongAudioResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/synthesizeLongAudioTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $input = new SynthesisInput(); + $audioConfig = new AudioConfig(); + $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; + $audioConfig->setAudioEncoding($audioConfigAudioEncoding); + $request = (new SynthesizeLongAudioRequest()) + ->setInput($input) + ->setAudioConfig($audioConfig); + $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInput(); + $this->assertProtobufEquals($input, $actualValue); + $actualValue = $actualApiRequestObject->getAudioConfig(); + $this->assertProtobufEquals($audioConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} From 8603e4715ee7c094388d48c61863df554f5641de Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 06:35:13 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- TextToSpeech/metadata/V1/CloudTts.php | 2 +- TextToSpeech/src/V1/AdvancedVoiceOptions.php | 141 ++++++- .../src/V1/StreamingSynthesisInput.php | 12 +- .../src/V1/StreamingSynthesizeConfig.php | 44 ++ TextToSpeech/src/V1/SynthesisInput.php | 12 +- .../src/V1/SynthesizeSpeechRequest.php | 14 +- .../Google/Cloud/Texttospeech/V1/CloudTts.php | 28 -- .../Cloud/Texttospeech/V1/CloudTtsLrs.php | 30 -- .../TextToSpeech/V1/AdvancedVoiceOptions.php | 230 ---------- .../HarmBlockThreshold.php | 82 ---- .../V1/AdvancedVoiceOptions/HarmCategory.php | 76 ---- .../V1/AdvancedVoiceOptions/SafetySetting.php | 101 ----- .../AdvancedVoiceOptions/SafetySettings.php | 67 --- .../Cloud/TextToSpeech/V1/AudioConfig.php | 329 --------------- .../Cloud/TextToSpeech/V1/AudioEncoding.php | 107 ----- .../V1/CustomPronunciationParams.php | 177 -------- .../PhoneticEncoding.php | 90 ---- .../TextToSpeech/V1/CustomPronunciations.php | 67 --- .../TextToSpeech/V1/CustomVoiceParams.php | 108 ----- .../V1/CustomVoiceParams/ReportedUsage.php | 65 --- .../TextToSpeech/V1/ListVoicesRequest.php | 115 ----- .../TextToSpeech/V1/ListVoicesResponse.php | 67 --- .../TextToSpeech/V1/MultiSpeakerMarkup.php | 67 --- .../V1/MultiSpeakerMarkup/Turn.php | 105 ----- .../V1/MultiSpeakerVoiceConfig.php | 72 ---- .../V1/MultispeakerPrebuiltVoice.php | 114 ----- .../Cloud/TextToSpeech/V1/SsmlVoiceGender.php | 73 ---- .../TextToSpeech/V1/StreamingAudioConfig.php | 155 ------- .../V1/StreamingSynthesisInput.php | 197 --------- .../V1/StreamingSynthesizeConfig.php | 237 ----------- .../V1/StreamingSynthesizeRequest.php | 118 ------ .../V1/StreamingSynthesizeResponse.php | 73 ---- .../Cloud/TextToSpeech/V1/SynthesisInput.php | 323 -------------- .../V1/SynthesizeLongAudioMetadata.php | 166 -------- .../V1/SynthesizeLongAudioRequest.php | 246 ----------- .../V1/SynthesizeLongAudioResponse.php | 33 -- .../V1/SynthesizeSpeechRequest.php | 226 ---------- .../V1/SynthesizeSpeechResponse.php | 83 ---- .../Google/Cloud/TextToSpeech/V1/Voice.php | 177 -------- .../TextToSpeech/V1/VoiceCloneParams.php | 67 --- .../TextToSpeech/V1/VoiceSelectionParams.php | 393 ------------------ .../V1/TextToSpeechClient/list_voices.php | 57 --- .../streaming_synthesize.php | 64 --- .../TextToSpeechClient/synthesize_speech.php | 94 ----- .../synthesize_long_audio.php | 89 ---- .../v1/src/V1/Client/TextToSpeechClient.php | 308 -------------- .../TextToSpeechLongAudioSynthesizeClient.php | 310 -------------- .../v1/src/V1/gapic_metadata.json | 47 --- .../text_to_speech_client_config.json | 58 --- .../text_to_speech_descriptor_config.php | 46 -- ...h_long_audio_synthesize_client_config.json | 37 -- ...ong_audio_synthesize_descriptor_config.php | 50 --- ...ng_audio_synthesize_rest_client_config.php | 65 --- .../text_to_speech_rest_client_config.php | 62 --- .../Unit/V1/Client/TextToSpeechClientTest.php | 325 --------------- ...tToSpeechLongAudioSynthesizeClientTest.php | 270 ------------ 56 files changed, 186 insertions(+), 6585 deletions(-) delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php delete mode 100644 owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php diff --git a/TextToSpeech/metadata/V1/CloudTts.php b/TextToSpeech/metadata/V1/CloudTts.php index 6196fc83e23b..09089fee21c9 100644 --- a/TextToSpeech/metadata/V1/CloudTts.php +++ b/TextToSpeech/metadata/V1/CloudTts.php @@ -19,7 +19,7 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xF2'\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8A\x01\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\$\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x06\xE0A\x04\xE0A\x01B \x0A\x1E_low_latency_journey_synthesis\"\xDD\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12W\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x94\x02\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" + "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" , true); static::$is_initialized = true; diff --git a/TextToSpeech/src/V1/AdvancedVoiceOptions.php b/TextToSpeech/src/V1/AdvancedVoiceOptions.php index f202d638c3e2..d30dc7f08739 100644 --- a/TextToSpeech/src/V1/AdvancedVoiceOptions.php +++ b/TextToSpeech/src/V1/AdvancedVoiceOptions.php @@ -23,14 +23,29 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message */ protected $low_latency_journey_synthesis = null; /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated */ protected $relax_safety_filters = false; + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $safety_settings = null; + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_textnorm = null; /** * Constructor. @@ -42,10 +57,16 @@ class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message * Only for Journey voices. If false, the synthesis is context aware * and has a higher latency. * @type bool $relax_safety_filters - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * @type bool $enable_textnorm + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. * } */ public function __construct($data = NULL) { @@ -92,36 +113,118 @@ public function setLowLatencyJourneySynthesis($var) } /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @return bool + * @deprecated */ public function getRelaxSafetyFilters() { + if ($this->relax_safety_filters !== false) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); + } return $this->relax_safety_filters; } /** - * Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - * supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - * Otherwise, will return result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + * Optional. Input only. Deprecated, use safety_settings instead. + * If true, relaxes safety filters for Gemini TTS. * - * Generated from protobuf field bool relax_safety_filters = 8 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; * @param bool $var * @return $this + * @deprecated */ public function setRelaxSafetyFilters($var) { + @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->relax_safety_filters = $var; return $this; } + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null + */ + public function getSafetySettings() + { + return $this->safety_settings; + } + + public function hasSafetySettings() + { + return isset($this->safety_settings); + } + + public function clearSafetySettings() + { + unset($this->safety_settings); + } + + /** + * Optional. Input only. This applies to Gemini TTS only. If set, the category + * specified in the safety setting will be blocked if the harm probability is + * above the threshold. Otherwise, the safety filter will be disabled by + * default. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var + * @return $this + */ + public function setSafetySettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); + $this->safety_settings = $var; + + return $this; + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextnorm() + { + return isset($this->enable_textnorm) ? $this->enable_textnorm : false; + } + + public function hasEnableTextnorm() + { + return isset($this->enable_textnorm); + } + + public function clearEnableTextnorm() + { + unset($this->enable_textnorm); + } + + /** + * Optional. If true, textnorm will be applied to text input. This feature is + * enabled by default. Only applies for Gemini TTS. + * + * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextnorm($var) + { + GPBUtil::checkBool($var); + $this->enable_textnorm = $var; + + return $this; + } + } diff --git a/TextToSpeech/src/V1/StreamingSynthesisInput.php b/TextToSpeech/src/V1/StreamingSynthesisInput.php index 7e1176739a64..49624284bec9 100644 --- a/TextToSpeech/src/V1/StreamingSynthesisInput.php +++ b/TextToSpeech/src/V1/StreamingSynthesisInput.php @@ -34,8 +34,8 @@ class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message * contains complete, terminating sentences, which results in better prosody * in the output audio. * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup * Multi-speaker markup for Gemini TTS. This field may not * be used with any other voices. @@ -84,8 +84,8 @@ public function setText($var) } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -101,8 +101,8 @@ public function hasMarkup() } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php index f41fcec24009..d81c076523d6 100644 --- a/TextToSpeech/src/V1/StreamingSynthesizeConfig.php +++ b/TextToSpeech/src/V1/StreamingSynthesizeConfig.php @@ -40,6 +40,12 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $custom_pronunciations = null; + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_voice_options = null; /** * Constructor. @@ -60,6 +66,8 @@ class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message * In order to customize the pronunciation of a phrase, there must be an exact * match of the phrase in the input types. If using SSML, the phrase must not * be inside a phoneme tag. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Optional. Advanced voice options. * } */ public function __construct($data = NULL) { @@ -189,5 +197,41 @@ public function setCustomPronunciations($var) return $this; } + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Optional. Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + } diff --git a/TextToSpeech/src/V1/SynthesisInput.php b/TextToSpeech/src/V1/SynthesisInput.php index 192ac5065466..45bae6a448ea 100644 --- a/TextToSpeech/src/V1/SynthesisInput.php +++ b/TextToSpeech/src/V1/SynthesisInput.php @@ -51,8 +51,8 @@ class SynthesisInput extends \Google\Protobuf\Internal\Message * @type string $text * The raw text to be synthesized. * @type string $markup - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * @type string $ssml * The SSML document to be synthesized. The SSML document must be valid * and well-formed. Otherwise the RPC will fail and return @@ -115,8 +115,8 @@ public function setText($var) } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @return string @@ -132,8 +132,8 @@ public function hasMarkup() } /** - * Markup for HD voices specifically. This field may not be used with any - * other voices. + * Markup for Chirp 3: HD voices specifically. This field may not be used + * with any other voices. * * Generated from protobuf field string markup = 5; * @param string $var diff --git a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php index 79c547bc582b..2bb1c38b3c20 100644 --- a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php +++ b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php @@ -34,9 +34,9 @@ class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message */ protected $audio_config = null; /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; */ protected $advanced_voice_options = null; @@ -70,7 +70,7 @@ public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config * Required. The configuration of the synthesized audio. * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Advanced voice options. + * Optional. Advanced voice options. * } */ public function __construct($data = NULL) { @@ -187,9 +187,9 @@ public function setAudioConfig($var) } /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null */ public function getAdvancedVoiceOptions() @@ -208,9 +208,9 @@ public function clearAdvancedVoiceOptions() } /** - * Advanced voice options. + * Optional. Advanced voice options. * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var * @return $this */ diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php deleted file mode 100644 index 09089fee21c9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTts.php +++ /dev/null @@ -1,28 +0,0 @@ -internalAddGeneratedFile( - "\x0A\x89/\x0A,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\"/\x0A\x11ListVoicesRequest\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"I\x0A\x12ListVoicesResponse\x123\x0A\x06voices\x18\x01 \x03(\x0B2#.google.cloud.texttospeech.v1.Voice\"\x94\x01\x0A\x05Voice\x12\x16\x0A\x0Elanguage_codes\x18\x01 \x03(\x09\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\x0A\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xA3\x07\x0A\x14AdvancedVoiceOptions\x12*\x0A\x1Dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12&\x0A\x14relax_safety_filters\x18\x08 \x01(\x08B\x08\x18\x01\xE0A\x04\xE0A\x01\x12b\x0A\x0Fsafety_settings\x18\x09 \x01(\x0B2A.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettingsB\x06\xE0A\x04\xE0A\x01\x12!\x0A\x0Fenable_textnorm\x18\x02 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A\xBC\x01\x0A\x0DSafetySetting\x12Q\x0A\x08category\x18\x01 \x01(\x0E2?.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory\x12X\x0A\x09threshold\x18\x02 \x01(\x0E2E.google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold\x1Ad\x0A\x0ESafetySettings\x12R\x0A\x08settings\x18\x01 \x03(\x0B2@.google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting\"\xB4\x01\x0A\x0CHarmCategory\x12\x1D\x0A\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1D\x0A\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\x0A\x1FHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1C\x0A\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\x0A\x1FHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\"\x9D\x01\x0A\x12HarmBlockThreshold\x12\$\x0A HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\x0A\x13BLOCK_LOW_AND_ABOVE\x10\x01\x12\x1A\x0A\x16BLOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\x0A\x0FBLOCK_ONLY_HIGH\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04\x12\x07\x0A\x03OFF\x10\x05B \x0A\x1E_low_latency_journey_synthesisB\x12\x0A\x10_enable_textnorm\"\xE2\x02\x0A\x17SynthesizeSpeechRequest\x12@\x0A\x05input\x18\x01 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12F\x0A\x05voice\x18\x02 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\\\x0A\x16advanced_voice_options\x18\x08 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xA2\x03\x0A\x19CustomPronunciationParams\x12\x13\x0A\x06phrase\x18\x01 \x01(\x09H\x00\x88\x01\x01\x12h\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1A\x0A\x0Dpronunciation\x18\x03 \x01(\x09H\x02\x88\x01\x01\"\xB6\x01\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12'\x0A#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1C\x0A\x18PHONETIC_ENCODING_PINYIN\x10\x04B\x09\x0A\x07_phraseB\x14\x0A\x12_phonetic_encodingB\x10\x0A\x0E_pronunciation\"g\x0A\x14CustomPronunciations\x12O\x0A\x0Epronunciations\x18\x01 \x03(\x0B27.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\x0A\x12MultiSpeakerMarkup\x12I\x0A\x05turns\x18\x01 \x03(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xE0A\x02\x1A/\x0A\x04Turn\x12\x14\x0A\x07speaker\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x02\"P\x0A\x19MultispeakerPrebuiltVoice\x12\x1A\x0A\x0Dspeaker_alias\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aspeaker_id\x18\x02 \x01(\x09B\x03\xE0A\x02\"v\x0A\x17MultiSpeakerVoiceConfig\x12[\x0A\x15speaker_voice_configs\x18\x02 \x03(\x0B27.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xE0A\x02\"\x9C\x02\x0A\x0ESynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12\x0E\x0A\x04ssml\x18\x02 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x04 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01\x12V\x0A\x15custom_pronunciations\x18\x03 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\x8E\x03\x0A\x14VoiceSelectionParams\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x0C\x0A\x04name\x18\x02 \x01(\x09\x12B\x0A\x0Bssml_gender\x18\x03 \x01(\x0E2-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12E\x0A\x0Ccustom_voice\x18\x04 \x01(\x0B2/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\x0A\x0Bvoice_clone\x18\x05 \x01(\x0B2..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xE0A\x01\x12\x17\x0A\x0Amodel_name\x18\x06 \x01(\x09B\x03\xE0A\x01\x12^\x0A\x1Amulti_speaker_voice_config\x18\x07 \x01(\x0B25.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xE0A\x01\"\xF1\x01\x0A\x0BAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1D\x0A\x0Dspeaking_rate\x18\x02 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x15\x0A\x05pitch\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x0Evolume_gain_db\x18\x04 \x01(\x01B\x06\xE0A\x04\xE0A\x01\x12\x1E\x0A\x11sample_rate_hertz\x18\x05 \x01(\x05B\x03\xE0A\x01\x12\"\x0A\x12effects_profile_id\x18\x06 \x03(\x09B\x06\xE0A\x04\xE0A\x01\"\xF1\x01\x0A\x11CustomVoiceParams\x122\x0A\x05model\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bautoml.googleapis.com/Model\x12\\\x0A\x0Ereported_usage\x18\x03 \x01(\x0E2=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xE0A\x01\"J\x0A\x0DReportedUsage\x12\x1E\x0A\x1AREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REALTIME\x10\x01\x12\x0B\x0A\x07OFFLINE\x10\x02\"2\x0A\x10VoiceCloneParams\x12\x1E\x0A\x11voice_cloning_key\x18\x01 \x01(\x09B\x03\xE0A\x02\"1\x0A\x18SynthesizeSpeechResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C\"\x9F\x01\x0A\x14StreamingAudioConfig\x12H\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x1D\x0A\x0Dspeaking_rate\x18\x03 \x01(\x01B\x06\xE0A\x04\xE0A\x01\"\x8D\x03\x0A\x19StreamingSynthesizeConfig\x12F\x0A\x05voice\x18\x01 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\x12W\x0A\x16streaming_audio_config\x18\x04 \x01(\x0B22.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xE0A\x01\x12V\x0A\x15custom_pronunciations\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xE0A\x01\x12\\\x0A\x16advanced_voice_options\x18\x07 \x01(\x0B22.google.cloud.texttospeech.v1.AdvancedVoiceOptionsB\x03\xE0A\x01H\x00\x88\x01\x01B\x19\x0A\x17_advanced_voice_options\"\xBD\x01\x0A\x17StreamingSynthesisInput\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06markup\x18\x05 \x01(\x09H\x00\x12P\x0A\x14multi_speaker_markup\x18\x07 \x01(\x0B20.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\x0A\x06prompt\x18\x06 \x01(\x09H\x01\x88\x01\x01B\x0E\x0A\x0Cinput_sourceB\x09\x0A\x07_prompt\"\xCE\x01\x0A\x1AStreamingSynthesizeRequest\x12S\x0A\x10streaming_config\x18\x01 \x01(\x0B27.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12F\x0A\x05input\x18\x02 \x01(\x0B25.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00B\x13\x0A\x11streaming_request\"4\x0A\x1BStreamingSynthesizeResponse\x12\x15\x0A\x0Daudio_content\x18\x01 \x01(\x0C*W\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\x0A\x04MALE\x10\x01\x12\x0A\x0A\x06FEMALE\x10\x02\x12\x0B\x0A\x07NEUTRAL\x10\x03*{\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08LINEAR16\x10\x01\x12\x07\x0A\x03MP3\x10\x02\x12\x0C\x0A\x08OGG_OPUS\x10\x03\x12\x09\x0A\x05MULAW\x10\x05\x12\x08\x0A\x04ALAW\x10\x06\x12\x07\x0A\x03PCM\x10\x07\x12\x07\x0A\x03M4A\x10\x082\xC7\x04\x0A\x0CTextToSpeech\x12\x93\x01\x0A\x0AListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1A0.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xDAA\x0Dlanguage_code\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/voices\x12\xBC\x01\x0A\x10SynthesizeSpeech\x125.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1A6.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xDAA\x18input,voice,audio_config\x82\xD3\xE4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\x0A\x13StreamingSynthesize\x128.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1A9.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x010\x01\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xBC\x02\x0A com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xA2\x02\x04CTTS\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php b/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php deleted file mode 100644 index 78b5cfdb66d4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/GPBMetadata/Google/Cloud/Texttospeech/V1/CloudTtsLrs.php +++ /dev/null @@ -1,30 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xFC\x0A\x0A0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1Cgoogle.cloud.texttospeech.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A,google/cloud/texttospeech/v1/cloud_tts.proto\x1A#google/longrunning/operations.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x02\x0A\x1ASynthesizeLongAudioRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12@\x0A\x05input\x18\x02 \x01(\x0B2,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xE0A\x02\x12D\x0A\x0Caudio_config\x18\x03 \x01(\x0B2).google.cloud.texttospeech.v1.AudioConfigB\x03\xE0A\x02\x12\x1B\x0A\x0Eoutput_gcs_uri\x18\x04 \x01(\x09B\x03\xE0A\x02\x12F\x0A\x05voice\x18\x05 \x01(\x0B22.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xE0A\x02\"\x1D\x0A\x1BSynthesizeLongAudioResponse\"\xA4\x01\x0A\x1BSynthesizeLongAudioMetadata\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x128\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x02\x18\x01\x12\x1B\x0A\x13progress_percentage\x18\x03 \x01(\x012\x9F\x03\x0A\x1FTextToSpeechLongAudioSynthesize\x12\xAA\x02\x0A\x13SynthesizeLongAudio\x128.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAt\x0A8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x128google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xD3\xE4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1AO\xCAA\x1Btexttospeech.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEF\x01\x0A com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xAA\x02\x1CGoogle.Cloud.TextToSpeech.V1\xCA\x02\x1CGoogle\\Cloud\\TextToSpeech\\V1\xEA\x02\x1FGoogle::Cloud::TextToSpeech::V1b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php deleted file mode 100644 index d30dc7f08739..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions.php +++ /dev/null @@ -1,230 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions - */ -class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - */ - protected $low_latency_journey_synthesis = null; - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $relax_safety_filters = false; - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $safety_settings = null; - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_textnorm = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $low_latency_journey_synthesis - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * @type bool $relax_safety_filters - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $safety_settings - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * @type bool $enable_textnorm - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @return bool - */ - public function getLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; - } - - public function hasLowLatencyJourneySynthesis() - { - return isset($this->low_latency_journey_synthesis); - } - - public function clearLowLatencyJourneySynthesis() - { - unset($this->low_latency_journey_synthesis); - } - - /** - * Only for Journey voices. If false, the synthesis is context aware - * and has a higher latency. - * - * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; - * @param bool $var - * @return $this - */ - public function setLowLatencyJourneySynthesis($var) - { - GPBUtil::checkBool($var); - $this->low_latency_journey_synthesis = $var; - - return $this; - } - - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return bool - * @deprecated - */ - public function getRelaxSafetyFilters() - { - if ($this->relax_safety_filters !== false) { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); - } - return $this->relax_safety_filters; - } - - /** - * Optional. Input only. Deprecated, use safety_settings instead. - * If true, relaxes safety filters for Gemini TTS. - * - * Generated from protobuf field bool relax_safety_filters = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setRelaxSafetyFilters($var) - { - @trigger_error('relax_safety_filters is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->relax_safety_filters = $var; - - return $this; - } - - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings|null - */ - public function getSafetySettings() - { - return $this->safety_settings; - } - - public function hasSafetySettings() - { - return isset($this->safety_settings); - } - - public function clearSafetySettings() - { - unset($this->safety_settings); - } - - /** - * Optional. Input only. This applies to Gemini TTS only. If set, the category - * specified in the safety setting will be blocked if the harm probability is - * above the threshold. Otherwise, the safety filter will be disabled by - * default. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings safety_settings = 9 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings $var - * @return $this - */ - public function setSafetySettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySettings::class); - $this->safety_settings = $var; - - return $this; - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableTextnorm() - { - return isset($this->enable_textnorm) ? $this->enable_textnorm : false; - } - - public function hasEnableTextnorm() - { - return isset($this->enable_textnorm); - } - - public function clearEnableTextnorm() - { - unset($this->enable_textnorm); - } - - /** - * Optional. If true, textnorm will be applied to text input. This feature is - * enabled by default. Only applies for Gemini TTS. - * - * Generated from protobuf field optional bool enable_textnorm = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableTextnorm($var) - { - GPBUtil::checkBool($var); - $this->enable_textnorm = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php deleted file mode 100644 index c2c2a32aae59..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmBlockThreshold.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold - */ -class HarmBlockThreshold -{ - /** - * The harm block threshold is unspecified. - * - * Generated from protobuf enum HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; - */ - const HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; - /** - * Block content with a low harm probability or higher. - * - * Generated from protobuf enum BLOCK_LOW_AND_ABOVE = 1; - */ - const BLOCK_LOW_AND_ABOVE = 1; - /** - * Block content with a medium harm probability or higher. - * - * Generated from protobuf enum BLOCK_MEDIUM_AND_ABOVE = 2; - */ - const BLOCK_MEDIUM_AND_ABOVE = 2; - /** - * Block content with a high harm probability. - * - * Generated from protobuf enum BLOCK_ONLY_HIGH = 3; - */ - const BLOCK_ONLY_HIGH = 3; - /** - * Do not block any content, regardless of its harm probability. - * - * Generated from protobuf enum BLOCK_NONE = 4; - */ - const BLOCK_NONE = 4; - /** - * Turn off the safety filter entirely. - * - * Generated from protobuf enum OFF = 5; - */ - const OFF = 5; - - private static $valueToName = [ - self::HARM_BLOCK_THRESHOLD_UNSPECIFIED => 'HARM_BLOCK_THRESHOLD_UNSPECIFIED', - self::BLOCK_LOW_AND_ABOVE => 'BLOCK_LOW_AND_ABOVE', - self::BLOCK_MEDIUM_AND_ABOVE => 'BLOCK_MEDIUM_AND_ABOVE', - self::BLOCK_ONLY_HIGH => 'BLOCK_ONLY_HIGH', - self::BLOCK_NONE => 'BLOCK_NONE', - self::OFF => 'OFF', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php deleted file mode 100644 index cf4329b14f5e..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/HarmCategory.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory - */ -class HarmCategory -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum HARM_CATEGORY_UNSPECIFIED = 0; - */ - const HARM_CATEGORY_UNSPECIFIED = 0; - /** - * Content that promotes violence or incites hatred against individuals or - * groups based on certain attributes. - * - * Generated from protobuf enum HARM_CATEGORY_HATE_SPEECH = 1; - */ - const HARM_CATEGORY_HATE_SPEECH = 1; - /** - * Content that promotes, facilitates, or enables dangerous activities. - * - * Generated from protobuf enum HARM_CATEGORY_DANGEROUS_CONTENT = 2; - */ - const HARM_CATEGORY_DANGEROUS_CONTENT = 2; - /** - * Abusive, threatening, or content intended to bully, torment, or ridicule. - * - * Generated from protobuf enum HARM_CATEGORY_HARASSMENT = 3; - */ - const HARM_CATEGORY_HARASSMENT = 3; - /** - * Content that contains sexually explicit material. - * - * Generated from protobuf enum HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; - */ - const HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; - - private static $valueToName = [ - self::HARM_CATEGORY_UNSPECIFIED => 'HARM_CATEGORY_UNSPECIFIED', - self::HARM_CATEGORY_HATE_SPEECH => 'HARM_CATEGORY_HATE_SPEECH', - self::HARM_CATEGORY_DANGEROUS_CONTENT => 'HARM_CATEGORY_DANGEROUS_CONTENT', - self::HARM_CATEGORY_HARASSMENT => 'HARM_CATEGORY_HARASSMENT', - self::HARM_CATEGORY_SEXUALLY_EXPLICIT => 'HARM_CATEGORY_SEXUALLY_EXPLICIT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php deleted file mode 100644 index 7a43b6d3e35c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySetting.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting - */ -class SafetySetting extends \Google\Protobuf\Internal\Message -{ - /** - * The harm category to apply the safety setting to. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; - */ - protected $category = 0; - /** - * The harm block threshold for the safety setting. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; - */ - protected $threshold = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $category - * The harm category to apply the safety setting to. - * @type int $threshold - * The harm block threshold for the safety setting. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The harm category to apply the safety setting to. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; - * @return int - */ - public function getCategory() - { - return $this->category; - } - - /** - * The harm category to apply the safety setting to. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory category = 1; - * @param int $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmCategory::class); - $this->category = $var; - - return $this; - } - - /** - * The harm block threshold for the safety setting. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; - * @return int - */ - public function getThreshold() - { - return $this->threshold; - } - - /** - * The harm block threshold for the safety setting. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold threshold = 2; - * @param int $var - * @return $this - */ - public function setThreshold($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\HarmBlockThreshold::class); - $this->threshold = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php deleted file mode 100644 index 8fedf168ccfd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AdvancedVoiceOptions/SafetySettings.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings - */ -class SafetySettings extends \Google\Protobuf\Internal\Message -{ - /** - * The safety settings for the request. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; - */ - private $settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $settings - * The safety settings for the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The safety settings for the request. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting> - */ - public function getSettings() - { - return $this->settings; - } - - /** - * The safety settings for the request. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting settings = 1; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting[] $var - * @return $this - */ - public function setSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions\SafetySetting::class); - $this->settings = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php deleted file mode 100644 index e490622773f8..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioConfig.php +++ /dev/null @@ -1,329 +0,0 @@ -google.cloud.texttospeech.v1.AudioConfig - */ -class AudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_encoding = 0; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $pitch = 0.0; - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $volume_gain_db = 0.0; - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $sample_rate_hertz = 0; - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - private $effects_profile_id; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * @type float $pitch - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * @type float $volume_gain_db - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * @type string[] $effects_profile_id - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * - * 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. - * - * 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. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getPitch() - { - return $this->pitch; - } - - /** - * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - * increase 20 semitones from the original pitch. -20 means decrease 20 - * semitones from the original pitch. - * - * Generated from protobuf field double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setPitch($var) - { - GPBUtil::checkDouble($var); - $this->pitch = $var; - - return $this; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getVolumeGainDb() - { - return $this->volume_gain_db; - } - - /** - * Optional. Input only. Volume gain (in dB) of the normal native volume - * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - * set to a value of 0.0 (dB), will play at normal native signal amplitude. A - * value of -6.0 (dB) will play at approximately half the amplitude of the - * normal native signal amplitude. A value of +6.0 (dB) will play at - * approximately twice the amplitude of the normal native signal amplitude. - * Strongly recommend not to exceed +10 (dB) as there's usually no effective - * increase in loudness for any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setVolumeGainDb($var) - { - GPBUtil::checkDouble($var); - $this->volume_gain_db = $var; - - return $this; - } - - /** - * Optional. The synthesis sample rate (in hertz) for this audio. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.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. When this is - * specified in SynthesizeSpeechRequest, if this is different from the voice's - * natural sample rate, then the synthesizer will honor this request by - * converting to the desired sample rate (which might result in worse audio - * quality), unless the specified sample rate is not supported for the - * encoding chosen, in which case it will fail the request and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf field int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return RepeatedField - */ - public function getEffectsProfileId() - { - return $this->effects_profile_id; - } - - /** - * Optional. Input only. An identifier which selects 'audio effects' profiles - * that are applied on (post synthesized) text to speech. Effects are applied - * on top of each other in the order they are given. See - * [audio - * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - * current supported profile ids. - * - * Generated from protobuf field repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param string[] $var - * @return $this - */ - public function setEffectsProfileId($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->effects_profile_id = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php deleted file mode 100644 index f1840272c122..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/AudioEncoding.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.texttospeech.v1.AudioEncoding - */ -class AudioEncoding -{ - /** - * Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return - * result - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - * - * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; - */ - const AUDIO_ENCODING_UNSPECIFIED = 0; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Audio content returned as LINEAR16 also contains a WAV header. - * - * Generated from protobuf enum LINEAR16 = 1; - */ - const LINEAR16 = 1; - /** - * MP3 audio at 32kbps. - * - * Generated from protobuf enum MP3 = 2; - */ - const MP3 = 2; - /** - * Opus encoded audio wrapped in an ogg container. The result is a - * file which can be played natively on Android, and in browsers (at least - * Chrome and Firefox). The quality of the encoding is considerably higher - * than MP3 while using approximately the same bitrate. - * - * Generated from protobuf enum OGG_OPUS = 3; - */ - const OGG_OPUS = 3; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - * Audio content returned as MULAW also contains a WAV header. - * - * Generated from protobuf enum MULAW = 5; - */ - const MULAW = 5; - /** - * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - * Audio content returned as ALAW also contains a WAV header. - * - * Generated from protobuf enum ALAW = 6; - */ - const ALAW = 6; - /** - * Uncompressed 16-bit signed little-endian samples (Linear PCM). - * Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or - * any other) header. - * - * Generated from protobuf enum PCM = 7; - */ - const PCM = 7; - /** - * M4A audio. - * - * Generated from protobuf enum M4A = 8; - */ - const M4A = 8; - - private static $valueToName = [ - self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', - self::LINEAR16 => 'LINEAR16', - self::MP3 => 'MP3', - self::OGG_OPUS => 'OGG_OPUS', - self::MULAW => 'MULAW', - self::ALAW => 'ALAW', - self::PCM => 'PCM', - self::M4A => 'M4A', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php deleted file mode 100644 index 2c5b30d8ee8c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams - */ -class CustomPronunciationParams extends \Google\Protobuf\Internal\Message -{ - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - */ - protected $phrase = null; - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - */ - protected $phonetic_encoding = null; - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - */ - protected $pronunciation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $phrase - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * @type int $phonetic_encoding - * The phonetic encoding of the phrase. - * @type string $pronunciation - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @return string - */ - public function getPhrase() - { - return isset($this->phrase) ? $this->phrase : ''; - } - - public function hasPhrase() - { - return isset($this->phrase); - } - - public function clearPhrase() - { - unset($this->phrase); - } - - /** - * The phrase to which the customization is applied. - * The phrase can be multiple words, such as proper nouns, but shouldn't span - * the length of the sentence. - * - * Generated from protobuf field optional string phrase = 1; - * @param string $var - * @return $this - */ - public function setPhrase($var) - { - GPBUtil::checkString($var, True); - $this->phrase = $var; - - return $this; - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @return int - */ - public function getPhoneticEncoding() - { - return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; - } - - public function hasPhoneticEncoding() - { - return isset($this->phonetic_encoding); - } - - public function clearPhoneticEncoding() - { - unset($this->phonetic_encoding); - } - - /** - * The phonetic encoding of the phrase. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; - * @param int $var - * @return $this - */ - public function setPhoneticEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); - $this->phonetic_encoding = $var; - - return $this; - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @return string - */ - public function getPronunciation() - { - return isset($this->pronunciation) ? $this->pronunciation : ''; - } - - public function hasPronunciation() - { - return isset($this->pronunciation); - } - - public function clearPronunciation() - { - unset($this->pronunciation); - } - - /** - * The pronunciation of the phrase. This must be in the phonetic encoding - * specified above. - * - * Generated from protobuf field optional string pronunciation = 3; - * @param string $var - * @return $this - */ - public function setPronunciation($var) - { - GPBUtil::checkString($var, True); - $this->pronunciation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php deleted file mode 100644 index c2402dce74e4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciationParams/PhoneticEncoding.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding - */ -class PhoneticEncoding -{ - /** - * Not specified. - * - * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; - */ - const PHONETIC_ENCODING_UNSPECIFIED = 0; - /** - * IPA, such as apple -> ˈæpəl. - * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - * - * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; - */ - const PHONETIC_ENCODING_IPA = 1; - /** - * X-SAMPA, such as apple -> "{p\@l". - * https://en.wikipedia.org/wiki/X-SAMPA - * - * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; - */ - const PHONETIC_ENCODING_X_SAMPA = 2; - /** - * For reading-to-pron conversion to work well, the `pronunciation` field - * should only contain Kanji, Hiragana, and Katakana. - * The pronunciation can also contain pitch accents. - * The start of a pitch phrase is specified with `^` and the down-pitch - * position is specified with `!`, for example: - * phrase:端 pronunciation:^はし - * phrase:箸 pronunciation:^は!し - * phrase:橋 pronunciation:^はし! - * We currently only support the Tokyo dialect, which allows at most one - * down-pitch per phrase (i.e. at most one `!` between `^`). - * - * Generated from protobuf enum PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - */ - const PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3; - /** - * Used to specify pronunciations for Mandarin words. See - * https://en.wikipedia.org/wiki/Pinyin. - * For example: 朝阳, the pronunciation is "chao2 yang2". The number - * represents the tone, and there is a space between syllables. Neutral - * tones are represented by 5, for example 孩子 "hai2 zi5". - * - * Generated from protobuf enum PHONETIC_ENCODING_PINYIN = 4; - */ - const PHONETIC_ENCODING_PINYIN = 4; - - private static $valueToName = [ - self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', - self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', - self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', - self::PHONETIC_ENCODING_JAPANESE_YOMIGANA => 'PHONETIC_ENCODING_JAPANESE_YOMIGANA', - self::PHONETIC_ENCODING_PINYIN => 'PHONETIC_ENCODING_PINYIN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php deleted file mode 100644 index 624e775a9ee3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomPronunciations.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.CustomPronunciations - */ -class CustomPronunciations extends \Google\Protobuf\Internal\Message -{ - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - */ - private $pronunciations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $pronunciations - * The pronunciation customizations are applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams> - */ - public function getPronunciations() - { - return $this->pronunciations; - } - - /** - * The pronunciation customizations are applied. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams[] $var - * @return $this - */ - public function setPronunciations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); - $this->pronunciations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php deleted file mode 100644 index f84c66d01a3a..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams - */ -class CustomVoiceParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $model = ''; - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $reported_usage = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $model - * Required. The name of the AutoML model that synthesizes the custom voice. - * @type int $reported_usage - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Required. The name of the AutoML model that synthesizes the custom voice. - * - * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return int - * @deprecated - */ - public function getReportedUsage() - { - if ($this->reported_usage !== 0) { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - } - return $this->reported_usage; - } - - /** - * Optional. Deprecated. The usage of the synthesized audio to be reported. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage reported_usage = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - * @deprecated - */ - public function setReportedUsage($var) - { - @trigger_error('reported_usage is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams\ReportedUsage::class); - $this->reported_usage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php deleted file mode 100644 index ecec1d4c0cc3..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/CustomVoiceParams/ReportedUsage.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage - */ -class ReportedUsage -{ - /** - * Request with reported usage unspecified will be rejected. - * - * Generated from protobuf enum REPORTED_USAGE_UNSPECIFIED = 0; - */ - const REPORTED_USAGE_UNSPECIFIED = 0; - /** - * For scenarios where the synthesized audio is not downloadable and can - * only be used once. For example, real-time request in IVR system. - * - * Generated from protobuf enum REALTIME = 1; - */ - const REALTIME = 1; - /** - * For scenarios where the synthesized audio is downloadable and can be - * reused. For example, the synthesized audio is downloaded, stored in - * customer service system and played repeatedly. - * - * Generated from protobuf enum OFFLINE = 2; - */ - const OFFLINE = 2; - - private static $valueToName = [ - self::REPORTED_USAGE_UNSPECIFIED => 'REPORTED_USAGE_UNSPECIFIED', - self::REALTIME => 'REALTIME', - self::OFFLINE => 'OFFLINE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php deleted file mode 100644 index 12a0e68e3f6b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesRequest - */ -class ListVoicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - - /** - * @param string $languageCode Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * @return \Google\Cloud\TextToSpeech\V1\ListVoicesRequest - * - * @experimental - */ - public static function build(string $languageCode): self - { - return (new self()) - ->setLanguageCode($languageCode); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * If not specified, the API will return all supported voices. - * If specified, the ListVoices call will only return voices that can be used - * to synthesize this language_code. For example, if you specify `"en-NZ"`, - * all `"en-NZ"` voices will be returned. If you specify `"no"`, both - * `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - * returned. - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php deleted file mode 100644 index fa9403399bd4..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/ListVoicesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.ListVoicesResponse - */ -class ListVoicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - */ - private $voices; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\Voice[] $voices - * The list of voices. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\Voice> - */ - public function getVoices() - { - return $this->voices; - } - - /** - * The list of voices. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.Voice voices = 1; - * @param \Google\Cloud\TextToSpeech\V1\Voice[] $var - * @return $this - */ - public function setVoices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class); - $this->voices = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php deleted file mode 100644 index f8f99a09a577..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup - */ -class MultiSpeakerMarkup extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $turns; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $turns - * Required. Speaker turns. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn> - */ - public function getTurns() - { - return $this->turns; - } - - /** - * Required. Speaker turns. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn turns = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn[] $var - * @return $this - */ - public function setTurns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup\Turn::class); - $this->turns = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php deleted file mode 100644 index 2a23ef66e117..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerMarkup/Turn.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn - */ -class Turn extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker = ''; - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $text = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * @type string $text - * Required. The text to speak. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeaker() - { - return $this->speaker; - } - - /** - * Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - * to documentation for available speakers. - * - * Generated from protobuf field string speaker = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeaker($var) - { - GPBUtil::checkString($var, True); - $this->speaker = $var; - - return $this; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Required. The text to speak. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php deleted file mode 100644 index 8da52d2fb891..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultiSpeakerVoiceConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig - */ -class MultiSpeakerVoiceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $speaker_voice_configs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $speaker_voice_configs - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return RepeatedField<\Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice> - */ - public function getSpeakerVoiceConfigs() - { - return $this->speaker_voice_configs; - } - - /** - * Required. A list of configurations for the voices of the speakers. Exactly - * two speaker voice configurations must be provided. - * - * Generated from protobuf field repeated .google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice speaker_voice_configs = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice[] $var - * @return $this - */ - public function setSpeakerVoiceConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\MultispeakerPrebuiltVoice::class); - $this->speaker_voice_configs = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php deleted file mode 100644 index 3b6efea63337..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/MultispeakerPrebuiltVoice.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice - */ -class MultispeakerPrebuiltVoice extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_alias = ''; - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $speaker_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $speaker_alias - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * @type string $speaker_id - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerAlias() - { - return $this->speaker_alias; - } - - /** - * Required. The speaker alias of the voice. This is the user-chosen speaker - * name that is used in the multispeaker text input, such as "Speaker1". - * - * Generated from protobuf field string speaker_alias = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerAlias($var) - { - GPBUtil::checkString($var, True); - $this->speaker_alias = $var; - - return $this; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSpeakerId() - { - return $this->speaker_id; - } - - /** - * Required. The speaker ID of the voice. See - * https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - * for available values. - * - * Generated from protobuf field string speaker_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSpeakerId($var) - { - GPBUtil::checkString($var, True); - $this->speaker_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php deleted file mode 100644 index ca9b5bfd29a5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SsmlVoiceGender.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.SsmlVoiceGender - */ -class SsmlVoiceGender -{ - /** - * An unspecified gender. - * In VoiceSelectionParams, this means that the client doesn't care which - * gender the selected voice will have. In the Voice field of - * ListVoicesResponse, this may mean that the voice doesn't fit any of the - * other categories in this enum, or that the gender of the voice isn't known. - * - * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; - */ - const SSML_VOICE_GENDER_UNSPECIFIED = 0; - /** - * A male voice. - * - * Generated from protobuf enum MALE = 1; - */ - const MALE = 1; - /** - * A female voice. - * - * Generated from protobuf enum FEMALE = 2; - */ - const FEMALE = 2; - /** - * A gender-neutral voice. This voice is not yet supported. - * - * Generated from protobuf enum NEUTRAL = 3; - */ - const NEUTRAL = 3; - - private static $valueToName = [ - self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', - self::MALE => 'MALE', - self::FEMALE => 'FEMALE', - self::NEUTRAL => 'NEUTRAL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php deleted file mode 100644 index 95dfe75a3cbd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingAudioConfig.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.texttospeech.v1.StreamingAudioConfig - */ -class StreamingAudioConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * return an error. - * @type int $sample_rate_hertz - * Optional. The synthesis sample rate (in hertz) for this audio. - * @type float $speaking_rate - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The format of the audio byte stream. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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. - * Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - * 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; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - * the normal native speed supported by the specific voice. 2.0 is twice as - * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - * speed. Any other values < 0.25 or > 2.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php deleted file mode 100644 index 49624284bec9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesisInput.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesisInput - */ -class StreamingSynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * @type string $prompt - * This is system instruction supported only for controllable voice models. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. It is recommended that each input - * contains complete, terminating sentences, which results in better prosody - * in the output audio. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(7); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(7); - } - - /** - * Multi-speaker markup for Gemini TTS. This field may not - * be used with any other voices. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 7; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This is system instruction supported only for controllable voice models. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php deleted file mode 100644 index d81c076523d6..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeConfig.php +++ /dev/null @@ -1,237 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeConfig - */ -class StreamingSynthesizeConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $streaming_audio_config = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $advanced_voice_options = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $streaming_audio_config - * Optional. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig|null - */ - public function getStreamingAudioConfig() - { - return $this->streaming_audio_config; - } - - public function hasStreamingAudioConfig() - { - return isset($this->streaming_audio_config); - } - - public function clearStreamingAudioConfig() - { - unset($this->streaming_audio_config); - } - - /** - * Optional. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingAudioConfig streaming_audio_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig $var - * @return $this - */ - public function setStreamingAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingAudioConfig::class); - $this->streaming_audio_config = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php deleted file mode 100644 index 4f79a5b8ca0d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeRequest.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeRequest - */ -class StreamingSynthesizeRequest extends \Google\Protobuf\Internal\Message -{ - protected $streaming_request; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $streaming_config - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * @type \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $input - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig|null - */ - public function getStreamingConfig() - { - return $this->readOneof(1); - } - - public function hasStreamingConfig() - { - return $this->hasOneof(1); - } - - /** - * StreamingSynthesizeConfig to be used in this streaming attempt. Only - * specified in the first message sent in a `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesizeConfig streaming_config = 1; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig $var - * @return $this - */ - public function setStreamingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesizeConfig::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @return \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput|null - */ - public function getInput() - { - return $this->readOneof(2); - } - - public function hasInput() - { - return $this->hasOneof(2); - } - - /** - * Input to synthesize. Specified in all messages but the first in a - * `StreamingSynthesize` call. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.StreamingSynthesisInput input = 2; - * @param \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\StreamingSynthesisInput::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getStreamingRequest() - { - return $this->whichOneof("streaming_request"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php deleted file mode 100644 index c817aee908d9..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/StreamingSynthesizeResponse.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.texttospeech.v1.StreamingSynthesizeResponse - */ -class StreamingSynthesizeResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request. This is - * headerless LINEAR16 audio with a sample rate of 24000. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php deleted file mode 100644 index 45bae6a448ea..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesisInput.php +++ /dev/null @@ -1,323 +0,0 @@ -google.cloud.texttospeech.v1.SynthesisInput - */ -class SynthesisInput extends \Google\Protobuf\Internal\Message -{ - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - */ - protected $prompt = null; - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $custom_pronunciations = null; - protected $input_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The raw text to be synthesized. - * @type string $markup - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * @type string $ssml - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $multi_speaker_markup - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * @type string $prompt - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->readOneof(1); - } - - public function hasText() - { - return $this->hasOneof(1); - } - - /** - * The raw text to be synthesized. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @return string - */ - public function getMarkup() - { - return $this->readOneof(5); - } - - public function hasMarkup() - { - return $this->hasOneof(5); - } - - /** - * Markup for Chirp 3: HD voices specifically. This field may not be used - * with any other voices. - * - * Generated from protobuf field string markup = 5; - * @param string $var - * @return $this - */ - public function setMarkup($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @return string - */ - public function getSsml() - { - return $this->readOneof(2); - } - - public function hasSsml() - { - return $this->hasOneof(2); - } - - /** - * The SSML document to be synthesized. The SSML document must be valid - * and well-formed. Otherwise the RPC will fail and return - * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - * more information, see - * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - * - * Generated from protobuf field string ssml = 2; - * @param string $var - * @return $this - */ - public function setSsml($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup|null - */ - public function getMultiSpeakerMarkup() - { - return $this->readOneof(4); - } - - public function hasMultiSpeakerMarkup() - { - return $this->hasOneof(4); - } - - /** - * The multi-speaker input to be synthesized. Only applicable for - * multi-speaker synthesis. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup $var - * @return $this - */ - public function setMultiSpeakerMarkup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerMarkup::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @return string - */ - public function getPrompt() - { - return isset($this->prompt) ? $this->prompt : ''; - } - - public function hasPrompt() - { - return isset($this->prompt); - } - - public function clearPrompt() - { - unset($this->prompt); - } - - /** - * This system instruction is supported only for controllable/promptable voice - * models. If this system instruction is used, we pass the unedited text to - * Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - * calls this system instruction, Style Instructions. - * - * Generated from protobuf field optional string prompt = 6; - * @param string $var - * @return $this - */ - public function setPrompt($var) - { - GPBUtil::checkString($var, True); - $this->prompt = $var; - - return $this; - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null - */ - public function getCustomPronunciations() - { - return $this->custom_pronunciations; - } - - public function hasCustomPronunciations() - { - return isset($this->custom_pronunciations); - } - - public function clearCustomPronunciations() - { - unset($this->custom_pronunciations); - } - - /** - * Optional. The pronunciation customizations are applied to the input. If - * this is set, the input is synthesized using the given pronunciation - * customizations. - * The initial support is for en-us, with plans to expand to other locales in - * the future. Instant Clone voices aren't supported. - * In order to customize the pronunciation of a phrase, there must be an exact - * match of the phrase in the input types. If using SSML, the phrase must not - * be inside a phoneme tag. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var - * @return $this - */ - public function setCustomPronunciations($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); - $this->custom_pronunciations = $var; - - return $this; - } - - /** - * @return string - */ - public function getInputSource() - { - return $this->whichOneof("input_source"); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php deleted file mode 100644 index a7081c28ca1b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioMetadata.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata - */ -class SynthesizeLongAudioMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @deprecated - */ - protected $last_update_time = null; - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - */ - protected $progress_percentage = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Time when the request was received. - * @type \Google\Protobuf\Timestamp $last_update_time - * Deprecated. Do not use. - * @type float $progress_percentage - * The progress of the most recent processing update in percentage, ie. 70.0%. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Time when the request was received. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @return \Google\Protobuf\Timestamp|null - * @deprecated - */ - public function getLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return $this->last_update_time; - } - - public function hasLastUpdateTime() - { - if (isset($this->last_update_time)) { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - } - return isset($this->last_update_time); - } - - public function clearLastUpdateTime() - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - unset($this->last_update_time); - } - - /** - * Deprecated. Do not use. - * - * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [deprecated = true]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - * @deprecated - */ - public function setLastUpdateTime($var) - { - @trigger_error('last_update_time is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_update_time = $var; - - return $this; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @return float - */ - public function getProgressPercentage() - { - return $this->progress_percentage; - } - - /** - * The progress of the most recent processing update in percentage, ie. 70.0%. - * - * Generated from protobuf field double progress_percentage = 3; - * @param float $var - * @return $this - */ - public function setProgressPercentage($var) - { - GPBUtil::checkDouble($var); - $this->progress_percentage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php deleted file mode 100644 index a53081392bfa..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioRequest.php +++ /dev/null @@ -1,246 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioRequest - */ -class SynthesizeLongAudioRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - */ - protected $parent = ''; - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_gcs_uri = ''; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type string $output_gcs_uri - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The resource states of the request in the form of - * `projects/{@*}locations/*`. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getOutputGcsUri() - { - return $this->output_gcs_uri; - } - - /** - * Required. Specifies a Cloud Storage URI for the synthesis results. Must be - * specified in the format: `gs://bucket_name/object_name`, and the bucket - * must already exist. - * - * Generated from protobuf field string output_gcs_uri = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setOutputGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->output_gcs_uri = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php deleted file mode 100644 index e945932a1d90..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeLongAudioResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeLongAudioResponse - */ -class SynthesizeLongAudioResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTtsLrs::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php deleted file mode 100644 index 2bb1c38b3c20..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechRequest.php +++ /dev/null @@ -1,226 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechRequest - */ -class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input = null; - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice = null; - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_config = null; - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $advanced_voice_options = null; - - /** - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice Required. The desired voice of the synthesized audio. - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig Required. The configuration of the synthesized audio. - * - * @return \Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest - * - * @experimental - */ - public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice, \Google\Cloud\TextToSpeech\V1\AudioConfig $audioConfig): self - { - return (new self()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\TextToSpeech\V1\SynthesisInput $input - * Required. The Synthesizer requires either plain text or SSML as input. - * @type \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $voice - * Required. The desired voice of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config - * Required. The configuration of the synthesized audio. - * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options - * Optional. Advanced voice options. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\SynthesisInput|null - */ - public function getInput() - { - return $this->input; - } - - public function hasInput() - { - return isset($this->input); - } - - public function clearInput() - { - unset($this->input); - } - - /** - * Required. The Synthesizer requires either plain text or SSML as input. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SynthesisInput input = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $var - * @return $this - */ - public function setInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); - $this->input = $var; - - return $this; - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Required. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceSelectionParams voice = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\TextToSpeech\V1\AudioConfig|null - */ - public function getAudioConfig() - { - return $this->audio_config; - } - - public function hasAudioConfig() - { - return isset($this->audio_config); - } - - public function clearAudioConfig() - { - unset($this->audio_config); - } - - /** - * Required. The configuration of the synthesized audio. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\TextToSpeech\V1\AudioConfig $var - * @return $this - */ - public function setAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); - $this->audio_config = $var; - - return $this; - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null - */ - public function getAdvancedVoiceOptions() - { - return $this->advanced_voice_options; - } - - public function hasAdvancedVoiceOptions() - { - return isset($this->advanced_voice_options); - } - - public function clearAdvancedVoiceOptions() - { - unset($this->advanced_voice_options); - } - - /** - * Optional. Advanced voice options. - * - * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var - * @return $this - */ - public function setAdvancedVoiceOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); - $this->advanced_voice_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php deleted file mode 100644 index 680f77554cac..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/SynthesizeSpeechResponse.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.texttospeech.v1.SynthesizeSpeechResponse - */ -class SynthesizeSpeechResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - */ - protected $audio_content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $audio_content - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @return string - */ - public function getAudioContent() - { - return $this->audio_content; - } - - /** - * The audio data bytes encoded as specified in the request, including the - * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - * For LINEAR16 audio, we include the WAV header. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - * - * Generated from protobuf field bytes audio_content = 1; - * @param string $var - * @return $this - */ - public function setAudioContent($var) - { - GPBUtil::checkString($var, False); - $this->audio_content = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php deleted file mode 100644 index d1b762b4b09e..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/Voice.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.texttospeech.v1.Voice - */ -class Voice extends \Google\Protobuf\Internal\Message -{ - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - */ - private $language_codes; - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - */ - protected $natural_sample_rate_hertz = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string[] $language_codes - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * @type string $name - * The name of this voice. Each distinct voice has a unique name. - * @type int $ssml_gender - * The gender of this voice. - * @type int $natural_sample_rate_hertz - * The natural sample rate (in hertz) for this voice. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @return RepeatedField - */ - public function getLanguageCodes() - { - return $this->language_codes; - } - - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - * - * Generated from protobuf field repeated string language_codes = 1; - * @param string[] $var - * @return $this - */ - public function setLanguageCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->language_codes = $arr; - - return $this; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of this voice. Each distinct voice has a unique name. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The gender of this voice. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @return int - */ - public function getNaturalSampleRateHertz() - { - return $this->natural_sample_rate_hertz; - } - - /** - * The natural sample rate (in hertz) for this voice. - * - * Generated from protobuf field int32 natural_sample_rate_hertz = 4; - * @param int $var - * @return $this - */ - public function setNaturalSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->natural_sample_rate_hertz = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php deleted file mode 100644 index b16e4fb4438d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceCloneParams.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.texttospeech.v1.VoiceCloneParams - */ -class VoiceCloneParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $voice_cloning_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $voice_cloning_key - * Required. Created by GenerateVoiceCloningKey. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVoiceCloningKey() - { - return $this->voice_cloning_key; - } - - /** - * Required. Created by GenerateVoiceCloningKey. - * - * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVoiceCloningKey($var) - { - GPBUtil::checkString($var, True); - $this->voice_cloning_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php b/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php deleted file mode 100644 index 8168d4784067..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/proto/src/Google/Cloud/TextToSpeech/V1/VoiceSelectionParams.php +++ /dev/null @@ -1,393 +0,0 @@ -google.cloud.texttospeech.v1.VoiceSelectionParams - */ -class VoiceSelectionParams extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $language_code = ''; - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - */ - protected $ssml_gender = 0; - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - */ - protected $custom_voice = null; - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $voice_clone = null; - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $model_name = ''; - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $multi_speaker_voice_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * @type string $name - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * @type int $ssml_gender - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * @type \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $custom_voice - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * @type string $model_name - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * @type \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $multi_speaker_voice_config - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); - parent::__construct($data); - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The language (and potentially also the region) of the voice - * expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - * language tag, e.g. "en-US". This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - * from the input provided in the SynthesisInput. The TTS service - * will use this parameter to help choose an appropriate voice. Note that - * the TTS service may choose a voice with a slightly different language code - * than the one selected; it may substitute a different region - * (e.g. using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" (Norwegian - * Bokmal) instead of "no" (Norwegian)". - * - * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the voice. If both the name and the gender are not set, - * the service will choose a voice based on the other parameters such as - * language_code. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a - * voice of the appropriate gender is not available, the synthesizer should - * substitute a voice with a different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @return \Google\Cloud\TextToSpeech\V1\CustomVoiceParams|null - */ - public function getCustomVoice() - { - return $this->custom_voice; - } - - public function hasCustomVoice() - { - return isset($this->custom_voice); - } - - public function clearCustomVoice() - { - unset($this->custom_voice); - } - - /** - * The configuration for a custom voice. If [CustomVoiceParams.model] is set, - * the service will choose the custom voice matching the specified - * configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; - * @param \Google\Cloud\TextToSpeech\V1\CustomVoiceParams $var - * @return $this - */ - public function setCustomVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomVoiceParams::class); - $this->custom_voice = $var; - - return $this; - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null - */ - public function getVoiceClone() - { - return $this->voice_clone; - } - - public function hasVoiceClone() - { - return isset($this->voice_clone); - } - - public function clearVoiceClone() - { - unset($this->voice_clone); - } - - /** - * Optional. The configuration for a voice clone. If - * [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - * clone matching the specified configuration. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var - * @return $this - */ - public function setVoiceClone($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); - $this->voice_clone = $var; - - return $this; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getModelName() - { - return $this->model_name; - } - - /** - * Optional. The name of the model. If set, the service will choose the model - * matching the specified configuration. - * - * Generated from protobuf field string model_name = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setModelName($var) - { - GPBUtil::checkString($var, True); - $this->model_name = $var; - - return $this; - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig|null - */ - public function getMultiSpeakerVoiceConfig() - { - return $this->multi_speaker_voice_config; - } - - public function hasMultiSpeakerVoiceConfig() - { - return isset($this->multi_speaker_voice_config); - } - - public function clearMultiSpeakerVoiceConfig() - { - unset($this->multi_speaker_voice_config); - } - - /** - * Optional. The configuration for a Gemini multi-speaker text-to-speech - * setup. Enables the use of two distinct voices in a single synthesis - * request. - * - * Generated from protobuf field .google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig multi_speaker_voice_config = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig $var - * @return $this - */ - public function setMultiSpeakerVoiceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\MultiSpeakerVoiceConfig::class); - $this->multi_speaker_voice_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php deleted file mode 100644 index 63287fc46efb..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/list_voices.php +++ /dev/null @@ -1,57 +0,0 @@ -listVoices($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php deleted file mode 100644 index 71c34862135f..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/streaming_synthesize.php +++ /dev/null @@ -1,64 +0,0 @@ -streamingSynthesize(); - $stream->writeAll([$request,]); - - /** @var StreamingSynthesizeResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php deleted file mode 100644 index b1cc1a69e31c..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechClient/synthesize_speech.php +++ /dev/null @@ -1,94 +0,0 @@ -setLanguageCode($voiceLanguageCode); - $audioConfig = (new AudioConfig()) - ->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var SynthesizeSpeechResponse $response */ - $response = $textToSpeechClient->synthesizeSpeech($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $voiceLanguageCode = '[LANGUAGE_CODE]'; - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_speech_sample($voiceLanguageCode, $audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php b/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php deleted file mode 100644 index 0ba4a026bd4b..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php +++ /dev/null @@ -1,89 +0,0 @@ -setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $textToSpeechLongAudioSynthesizeClient->synthesizeLongAudio($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var SynthesizeLongAudioResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - - synthesize_long_audio_sample($audioConfigAudioEncoding); -} -// [END texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php deleted file mode 100644 index 066691e4cffd..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechClient.php +++ /dev/null @@ -1,308 +0,0 @@ - listVoicesAsync(ListVoicesRequest $request, array $optionalArgs = []) - * @method PromiseInterface synthesizeSpeechAsync(SynthesizeSpeechRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeech'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Returns a list of Voice supported for synthesis. - * - * The async variant is {@see TextToSpeechClient::listVoicesAsync()} . - * - * @example samples/V1/TextToSpeechClient/list_voices.php - * - * @param ListVoicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ListVoicesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listVoices(ListVoicesRequest $request, array $callOptions = []): ListVoicesResponse - { - return $this->startApiCall('ListVoices', $request, $callOptions)->wait(); - } - - /** - * Performs bidirectional streaming speech synthesis: receives audio while - * sending text. - * - * @example samples/V1/TextToSpeechClient/streaming_synthesize.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingSynthesize(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingSynthesize', null, $callOptions); - } - - /** - * Synthesizes speech synchronously: receive results after all text input - * has been processed. - * - * The async variant is {@see TextToSpeechClient::synthesizeSpeechAsync()} . - * - * @example samples/V1/TextToSpeechClient/synthesize_speech.php - * - * @param SynthesizeSpeechRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SynthesizeSpeechResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeSpeech(SynthesizeSpeechRequest $request, array $callOptions = []): SynthesizeSpeechResponse - { - return $this->startApiCall('SynthesizeSpeech', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php b/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php deleted file mode 100644 index 56bf66fffe09..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/Client/TextToSpeechLongAudioSynthesizeClient.php +++ /dev/null @@ -1,310 +0,0 @@ - synthesizeLongAudioAsync(SynthesizeLongAudioRequest $request, array $optionalArgs = []) - */ -final class TextToSpeechLongAudioSynthesizeClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'texttospeech.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'texttospeech.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/text_to_speech_long_audio_synthesize_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = $this->descriptors[$methodName]['longRunning'] ?? []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName(string $project, string $location, string $model): string - { - return self::getPathTemplate('model')->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - model: projects/{project}/locations/{location}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'texttospeech.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Cloud\TextToSpeech\V1\TextToSpeechLongAudioSynthesizeClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new TextToSpeechLongAudioSynthesizeClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Synthesizes long form text asynchronously. - * - * The async variant is - * {@see TextToSpeechLongAudioSynthesizeClient::synthesizeLongAudioAsync()} . - * - * @example samples/V1/TextToSpeechLongAudioSynthesizeClient/synthesize_long_audio.php - * - * @param SynthesizeLongAudioRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function synthesizeLongAudio(SynthesizeLongAudioRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SynthesizeLongAudio', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json b/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json deleted file mode 100644 index aef5b6710920..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "Google\\Cloud\\TextToSpeech\\V1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechGapicClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "StreamingSynthesize": { - "methods": [ - "streamingSynthesize" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - } - } - }, - "TextToSpeechLongAudioSynthesize": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechLongAudioSynthesizeGapicClient", - "rpcs": { - "SynthesizeLongAudio": { - "methods": [ - "synthesizeLongAudio" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json deleted file mode 100644 index 6aaa36720e99..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeech": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "StreamingSynthesize": { - "timeout_millis": 300000 - }, - "SynthesizeSpeech": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php deleted file mode 100644 index ad4d236b8015..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_descriptor_config.php +++ /dev/null @@ -1,46 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\ListVoicesResponse', - ], - 'StreamingSynthesize' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\StreamingSynthesizeResponse', - ], - 'SynthesizeSpeech' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\TextToSpeech\V1\SynthesizeSpeechResponse', - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json deleted file mode 100644 index 1f2cda4e7cf5..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 5000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000000, - "total_timeout_millis": 5000000 - } - }, - "methods": { - "SynthesizeLongAudio": { - "timeout_millis": 5000000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php deleted file mode 100644 index c2b2750ecd9d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_descriptor_config.php +++ /dev/null @@ -1,50 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioResponse', - 'metadataReturnType' => '\Google\Cloud\TextToSpeech\V1\SynthesizeLongAudioMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'model' => 'projects/{project}/locations/{location}/models/{model}', - ], - ], - ], -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php deleted file mode 100644 index 4887663a2925..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_long_audio_synthesize_rest_client_config.php +++ /dev/null @@ -1,65 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' => [ - 'SynthesizeLongAudio' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:synthesizeLongAudio', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php b/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php deleted file mode 100644 index 6b0e6a003979..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/src/V1/resources/text_to_speech_rest_client_config.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - 'google.cloud.texttospeech.v1.TextToSpeech' => [ - 'ListVoices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/voices', - ], - 'SynthesizeSpeech' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/text:synthesize', - 'body' => '*', - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php deleted file mode 100644 index 86ed5387e74d..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechClientTest.php +++ /dev/null @@ -1,325 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechClient($options); - } - - /** @test */ - public function listVoicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoices($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListVoicesRequest(); - try { - $gapicClient->listVoices($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new StreamingSynthesizeResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - $audioContent2 = '-61'; - $expectedResponse2 = new StreamingSynthesizeResponse(); - $expectedResponse2->setAudioContent($audioContent2); - $transport->addResponse($expectedResponse2); - $audioContent3 = '-60'; - $expectedResponse3 = new StreamingSynthesizeResponse(); - $expectedResponse3->setAudioContent($audioContent3); - $transport->addResponse($expectedResponse3); - // Mock request - $request = new StreamingSynthesizeRequest(); - $request2 = new StreamingSynthesizeRequest(); - $request3 = new StreamingSynthesizeRequest(); - $bidi = $gapicClient->streamingSynthesize(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/StreamingSynthesize', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingSynthesizeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingSynthesize(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $audioContent = '16'; - $expectedResponse = new SynthesizeSpeechResponse(); - $expectedResponse->setAudioContent($audioContent); - $transport->addResponse($expectedResponse); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeSpeech($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech', $actualFuncCall); - $actualValue = $actualRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualRequestObject->getVoice(); - $this->assertProtobufEquals($voice, $actualValue); - $actualValue = $actualRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function synthesizeSpeechExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $voice = new VoiceSelectionParams(); - $voiceLanguageCode = 'voiceLanguageCode-686472265'; - $voice->setLanguageCode($voiceLanguageCode); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeSpeechRequest()) - ->setInput($input) - ->setVoice($voice) - ->setAudioConfig($audioConfig); - try { - $gapicClient->synthesizeSpeech($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVoicesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListVoicesResponse(); - $transport->addResponse($expectedResponse); - $request = new ListVoicesRequest(); - $response = $gapicClient->listVoicesAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeech/ListVoices', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php b/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php deleted file mode 100644 index 0e0de17a71d7..000000000000 --- a/owl-bot-staging/TextToSpeech/v1/tests/Unit/V1/Client/TextToSpeechLongAudioSynthesizeClientTest.php +++ /dev/null @@ -1,270 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TextToSpeechLongAudioSynthesizeClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TextToSpeechLongAudioSynthesizeClient($options); - } - - /** @test */ - public function synthesizeLongAudioTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudio($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function synthesizeLongAudioAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/synthesizeLongAudioTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SynthesizeLongAudioResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/synthesizeLongAudioTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $input = new SynthesisInput(); - $audioConfig = new AudioConfig(); - $audioConfigAudioEncoding = AudioEncoding::AUDIO_ENCODING_UNSPECIFIED; - $audioConfig->setAudioEncoding($audioConfigAudioEncoding); - $request = (new SynthesizeLongAudioRequest()) - ->setInput($input) - ->setAudioConfig($audioConfig); - $response = $gapicClient->synthesizeLongAudioAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize/SynthesizeLongAudio', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInput(); - $this->assertProtobufEquals($input, $actualValue); - $actualValue = $actualApiRequestObject->getAudioConfig(); - $this->assertProtobufEquals($audioConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/synthesizeLongAudioTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -}