Skip to content

Commit ac6a721

Browse files
feat: [google-cloud-texttospeech] add Gemini TTS Multispeaker API fields (#14508)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 809186275 Source-Link: googleapis/googleapis@b2cd70b Source-Link: googleapis/googleapis-gen@cbd7c4e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiY2JkN2M0ZWM1MWQwYWRhYzcyNzg3YWI3NGNlNDA3OGU3ZjI3YTg3YSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6842396 commit ac6a721

File tree

9 files changed

+87
-5
lines changed

9 files changed

+87
-5
lines changed

packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
ListVoicesRequest,
4141
ListVoicesResponse,
4242
MultiSpeakerMarkup,
43+
MultispeakerPrebuiltVoice,
44+
MultiSpeakerVoiceConfig,
4345
SsmlVoiceGender,
4446
StreamingAudioConfig,
4547
StreamingSynthesisInput,
@@ -72,6 +74,8 @@
7274
"ListVoicesRequest",
7375
"ListVoicesResponse",
7476
"MultiSpeakerMarkup",
77+
"MultispeakerPrebuiltVoice",
78+
"MultiSpeakerVoiceConfig",
7579
"StreamingAudioConfig",
7680
"StreamingSynthesisInput",
7781
"StreamingSynthesizeConfig",

packages/google-cloud-texttospeech/google/cloud/texttospeech/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.29.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
ListVoicesRequest,
3434
ListVoicesResponse,
3535
MultiSpeakerMarkup,
36+
MultispeakerPrebuiltVoice,
37+
MultiSpeakerVoiceConfig,
3638
SsmlVoiceGender,
3739
StreamingAudioConfig,
3840
StreamingSynthesisInput,
@@ -64,6 +66,8 @@
6466
"ListVoicesRequest",
6567
"ListVoicesResponse",
6668
"MultiSpeakerMarkup",
69+
"MultiSpeakerVoiceConfig",
70+
"MultispeakerPrebuiltVoice",
6771
"SsmlVoiceGender",
6872
"StreamingAudioConfig",
6973
"StreamingSynthesisInput",

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.29.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
ListVoicesRequest,
2424
ListVoicesResponse,
2525
MultiSpeakerMarkup,
26+
MultispeakerPrebuiltVoice,
27+
MultiSpeakerVoiceConfig,
2628
SsmlVoiceGender,
2729
StreamingAudioConfig,
2830
StreamingSynthesisInput,
@@ -51,6 +53,8 @@
5153
"ListVoicesRequest",
5254
"ListVoicesResponse",
5355
"MultiSpeakerMarkup",
56+
"MultispeakerPrebuiltVoice",
57+
"MultiSpeakerVoiceConfig",
5458
"StreamingAudioConfig",
5559
"StreamingSynthesisInput",
5660
"StreamingSynthesizeConfig",

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"CustomPronunciationParams",
3333
"CustomPronunciations",
3434
"MultiSpeakerMarkup",
35+
"MultispeakerPrebuiltVoice",
36+
"MultiSpeakerVoiceConfig",
3537
"SynthesisInput",
3638
"VoiceSelectionParams",
3739
"AudioConfig",
@@ -404,6 +406,53 @@ class Turn(proto.Message):
404406
)
405407

406408

409+
class MultispeakerPrebuiltVoice(proto.Message):
410+
r"""Configuration for a single speaker in a Gemini TTS
411+
multi-speaker setup. Enables dialogue between two speakers.
412+
413+
Attributes:
414+
speaker_alias (str):
415+
Required. The speaker alias of the voice.
416+
This is the user-chosen speaker name that is
417+
used in the multispeaker text input, such as
418+
"Speaker1".
419+
speaker_id (str):
420+
Required. The speaker ID of the voice. See
421+
https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options
422+
for available values.
423+
"""
424+
425+
speaker_alias: str = proto.Field(
426+
proto.STRING,
427+
number=1,
428+
)
429+
speaker_id: str = proto.Field(
430+
proto.STRING,
431+
number=2,
432+
)
433+
434+
435+
class MultiSpeakerVoiceConfig(proto.Message):
436+
r"""Configuration for a multi-speaker text-to-speech setup.
437+
Enables the use of up to two distinct voices in a single
438+
synthesis request.
439+
440+
Attributes:
441+
speaker_voice_configs (MutableSequence[google.cloud.texttospeech_v1.types.MultispeakerPrebuiltVoice]):
442+
Required. A list of configurations for the
443+
voices of the speakers. Exactly two speaker
444+
voice configurations must be provided.
445+
"""
446+
447+
speaker_voice_configs: MutableSequence[
448+
"MultispeakerPrebuiltVoice"
449+
] = proto.RepeatedField(
450+
proto.MESSAGE,
451+
number=2,
452+
message="MultispeakerPrebuiltVoice",
453+
)
454+
455+
407456
class SynthesisInput(proto.Message):
408457
r"""Contains text input to be synthesized. Either ``text`` or ``ssml``
409458
must be supplied. Supplying both or neither returns
@@ -542,6 +591,11 @@ class VoiceSelectionParams(proto.Message):
542591
Optional. The name of the model. If set, the
543592
service will choose the model matching the
544593
specified configuration.
594+
multi_speaker_voice_config (google.cloud.texttospeech_v1.types.MultiSpeakerVoiceConfig):
595+
Optional. The configuration for a Gemini
596+
multi-speaker text-to-speech setup. Enables the
597+
use of two distinct voices in a single synthesis
598+
request.
545599
"""
546600

547601
language_code: str = proto.Field(
@@ -571,6 +625,11 @@ class VoiceSelectionParams(proto.Message):
571625
proto.STRING,
572626
number=6,
573627
)
628+
multi_speaker_voice_config: "MultiSpeakerVoiceConfig" = proto.Field(
629+
proto.MESSAGE,
630+
number=7,
631+
message="MultiSpeakerVoiceConfig",
632+
)
574633

575634

576635
class AudioConfig(proto.Message):
@@ -827,6 +886,11 @@ class StreamingSynthesisInput(proto.Message):
827886
Markup for HD voices specifically. This field
828887
may not be used with any other voices.
829888
889+
This field is a member of `oneof`_ ``input_source``.
890+
multi_speaker_markup (google.cloud.texttospeech_v1.types.MultiSpeakerMarkup):
891+
Multi-speaker markup for Gemini TTS. This
892+
field may not be used with any other voices.
893+
830894
This field is a member of `oneof`_ ``input_source``.
831895
prompt (str):
832896
This is system instruction supported only for
@@ -845,6 +909,12 @@ class StreamingSynthesisInput(proto.Message):
845909
number=5,
846910
oneof="input_source",
847911
)
912+
multi_speaker_markup: "MultiSpeakerMarkup" = proto.Field(
913+
proto.MESSAGE,
914+
number=7,
915+
oneof="input_source",
916+
message="MultiSpeakerMarkup",
917+
)
848918
prompt: str = proto.Field(
849919
proto.STRING,
850920
number=6,

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.29.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-texttospeech",
11-
"version": "2.29.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-texttospeech",
11-
"version": "2.29.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)