Skip to content

Commit 6d622a3

Browse files
feat: [google-cloud-texttospeech] add brand voice lite, which lets you clone a voice with just 10 seconds of audio (#13192)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 688491221 Source-Link: googleapis/googleapis@60688dc Source-Link: googleapis/googleapis-gen@4072c99 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNDA3MmM5OTliMzZiYWEyMWNjYjI5YzVmNWQ1NjA4OTYyODQwYjMxYSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 91e9f9f commit 6d622a3

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
SynthesizeSpeechRequest,
4949
SynthesizeSpeechResponse,
5050
Voice,
51+
VoiceCloneParams,
5152
VoiceSelectionParams,
5253
)
5354
from google.cloud.texttospeech_v1.types.cloud_tts_lrs import (
@@ -76,6 +77,7 @@
7677
"SynthesizeSpeechRequest",
7778
"SynthesizeSpeechResponse",
7879
"Voice",
80+
"VoiceCloneParams",
7981
"VoiceSelectionParams",
8082
"AudioEncoding",
8183
"SsmlVoiceGender",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
SynthesizeSpeechRequest,
4242
SynthesizeSpeechResponse,
4343
Voice,
44+
VoiceCloneParams,
4445
VoiceSelectionParams,
4546
)
4647
from .types.cloud_tts_lrs import (
@@ -74,5 +75,6 @@
7475
"TextToSpeechClient",
7576
"TextToSpeechLongAudioSynthesizeClient",
7677
"Voice",
78+
"VoiceCloneParams",
7779
"VoiceSelectionParams",
7880
)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
SynthesizeSpeechRequest,
3232
SynthesizeSpeechResponse,
3333
Voice,
34+
VoiceCloneParams,
3435
VoiceSelectionParams,
3536
)
3637
from .cloud_tts_lrs import (
@@ -55,6 +56,7 @@
5556
"SynthesizeSpeechRequest",
5657
"SynthesizeSpeechResponse",
5758
"Voice",
59+
"VoiceCloneParams",
5860
"VoiceSelectionParams",
5961
"AudioEncoding",
6062
"SsmlVoiceGender",

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"VoiceSelectionParams",
3636
"AudioConfig",
3737
"CustomVoiceParams",
38+
"VoiceCloneParams",
3839
"SynthesizeSpeechResponse",
3940
"StreamingSynthesizeConfig",
4041
"StreamingSynthesisInput",
@@ -423,6 +424,10 @@ class VoiceSelectionParams(proto.Message):
423424
The configuration for a custom voice. If
424425
[CustomVoiceParams.model] is set, the service will choose
425426
the custom voice matching the specified configuration.
427+
voice_clone (google.cloud.texttospeech_v1.types.VoiceCloneParams):
428+
Optional. The configuration for a voice clone. If
429+
[VoiceCloneParams.voice_clone_key] is set, the service will
430+
choose the voice clone matching the specified configuration.
426431
"""
427432

428433
language_code: str = proto.Field(
@@ -443,6 +448,11 @@ class VoiceSelectionParams(proto.Message):
443448
number=4,
444449
message="CustomVoiceParams",
445450
)
451+
voice_clone: "VoiceCloneParams" = proto.Field(
452+
proto.MESSAGE,
453+
number=5,
454+
message="VoiceCloneParams",
455+
)
446456

447457

448458
class AudioConfig(proto.Message):
@@ -565,6 +575,20 @@ class ReportedUsage(proto.Enum):
565575
)
566576

567577

578+
class VoiceCloneParams(proto.Message):
579+
r"""The configuration of Voice Clone feature.
580+
581+
Attributes:
582+
voice_cloning_key (str):
583+
Required. Created by GenerateVoiceCloningKey.
584+
"""
585+
586+
voice_cloning_key: str = proto.Field(
587+
proto.STRING,
588+
number=1,
589+
)
590+
591+
568592
class SynthesizeSpeechResponse(proto.Message):
569593
r"""The message returned to the client by the ``SynthesizeSpeech``
570594
method.

0 commit comments

Comments
 (0)