Skip to content

Commit 5339bcb

Browse files
feat: [google-cloud-texttospeech] add Gemini TTS Multispeaker API fields (#14535)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 810470893 Source-Link: googleapis/googleapis@c821335 Source-Link: googleapis/googleapis-gen@ad75e1e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiYWQ3NWUxZTI5N2M3YTg5M2YyNzBiNWViODU0Y2U2MmRjZGM4YjU1MSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a999c67 commit 5339bcb

File tree

8 files changed

+83
-5
lines changed

8 files changed

+83
-5
lines changed

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.30.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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.30.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/__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,
@@ -65,6 +67,8 @@
6567
"ListVoicesRequest",
6668
"ListVoicesResponse",
6769
"MultiSpeakerMarkup",
70+
"MultiSpeakerVoiceConfig",
71+
"MultispeakerPrebuiltVoice",
6872
"SsmlVoiceGender",
6973
"StreamingAudioConfig",
7074
"StreamingSynthesisInput",

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.30.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/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,
@@ -52,6 +54,8 @@
5254
"ListVoicesRequest",
5355
"ListVoicesResponse",
5456
"MultiSpeakerMarkup",
57+
"MultispeakerPrebuiltVoice",
58+
"MultiSpeakerVoiceConfig",
5559
"StreamingAudioConfig",
5660
"StreamingSynthesisInput",
5761
"StreamingSynthesizeConfig",

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/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",
@@ -431,6 +433,53 @@ class Turn(proto.Message):
431433
)
432434

433435

436+
class MultispeakerPrebuiltVoice(proto.Message):
437+
r"""Configuration for a single speaker in a Gemini TTS
438+
multi-speaker setup. Enables dialogue between two speakers.
439+
440+
Attributes:
441+
speaker_alias (str):
442+
Required. The speaker alias of the voice.
443+
This is the user-chosen speaker name that is
444+
used in the multispeaker text input, such as
445+
"Speaker1".
446+
speaker_id (str):
447+
Required. The speaker ID of the voice. See
448+
https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options
449+
for available values.
450+
"""
451+
452+
speaker_alias: str = proto.Field(
453+
proto.STRING,
454+
number=1,
455+
)
456+
speaker_id: str = proto.Field(
457+
proto.STRING,
458+
number=2,
459+
)
460+
461+
462+
class MultiSpeakerVoiceConfig(proto.Message):
463+
r"""Configuration for a multi-speaker text-to-speech setup.
464+
Enables the use of up to two distinct voices in a single
465+
synthesis request.
466+
467+
Attributes:
468+
speaker_voice_configs (MutableSequence[google.cloud.texttospeech_v1beta1.types.MultispeakerPrebuiltVoice]):
469+
Required. A list of configurations for the
470+
voices of the speakers. Exactly two speaker
471+
voice configurations must be provided.
472+
"""
473+
474+
speaker_voice_configs: MutableSequence[
475+
"MultispeakerPrebuiltVoice"
476+
] = proto.RepeatedField(
477+
proto.MESSAGE,
478+
number=2,
479+
message="MultispeakerPrebuiltVoice",
480+
)
481+
482+
434483
class SynthesisInput(proto.Message):
435484
r"""Contains text input to be synthesized. Either ``text`` or ``ssml``
436485
must be supplied. Supplying both or neither returns
@@ -569,6 +618,11 @@ class VoiceSelectionParams(proto.Message):
569618
Optional. The name of the model. If set, the
570619
service will choose the model matching the
571620
specified configuration.
621+
multi_speaker_voice_config (google.cloud.texttospeech_v1beta1.types.MultiSpeakerVoiceConfig):
622+
Optional. The configuration for a Gemini
623+
multi-speaker text-to-speech setup. Enables the
624+
use of two distinct voices in a single synthesis
625+
request.
572626
"""
573627

574628
language_code: str = proto.Field(
@@ -598,6 +652,11 @@ class VoiceSelectionParams(proto.Message):
598652
proto.STRING,
599653
number=6,
600654
)
655+
multi_speaker_voice_config: "MultiSpeakerVoiceConfig" = proto.Field(
656+
proto.MESSAGE,
657+
number=7,
658+
message="MultiSpeakerVoiceConfig",
659+
)
601660

602661

603662
class AudioConfig(proto.Message):
@@ -893,6 +952,11 @@ class StreamingSynthesisInput(proto.Message):
893952
Markup for HD voices specifically. This field
894953
may not be used with any other voices.
895954
955+
This field is a member of `oneof`_ ``input_source``.
956+
multi_speaker_markup (google.cloud.texttospeech_v1beta1.types.MultiSpeakerMarkup):
957+
Multi-speaker markup for Gemini TTS. This
958+
field may not be used with any other voices.
959+
896960
This field is a member of `oneof`_ ``input_source``.
897961
prompt (str):
898962
This is system instruction supported only for
@@ -911,6 +975,12 @@ class StreamingSynthesisInput(proto.Message):
911975
number=5,
912976
oneof="input_source",
913977
)
978+
multi_speaker_markup: "MultiSpeakerMarkup" = proto.Field(
979+
proto.MESSAGE,
980+
number=7,
981+
oneof="input_source",
982+
message="MultiSpeakerMarkup",
983+
)
914984
prompt: str = proto.Field(
915985
proto.STRING,
916986
number=6,

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.30.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.30.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)