Skip to content

Commit b01d99d

Browse files
feat: [google-cloud-texttospeech] add multi-speaker markup, which allows generating dialogue between multiple speakers (googleapis#13223)
BEGIN_COMMIT_OVERRIDE feat: add multi-speaker markup, which allows generating dialogue between multiple speakers END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 690597076 Source-Link: googleapis/googleapis@3bc81b7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a2253a01e6e93e79a1dec7e0b2aeea708b634d1e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiYTIyNTNhMDFlNmU5M2U3OWExZGVjN2UwYjJhZWVhNzA4YjYzNGQxZSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8ca6f2c commit b01d99d

9 files changed

Lines changed: 59 additions & 5 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
@@ -39,6 +39,7 @@
3939
CustomVoiceParams,
4040
ListVoicesRequest,
4141
ListVoicesResponse,
42+
MultiSpeakerMarkup,
4243
SsmlVoiceGender,
4344
StreamingSynthesisInput,
4445
StreamingSynthesizeConfig,
@@ -69,6 +70,7 @@
6970
"CustomVoiceParams",
7071
"ListVoicesRequest",
7172
"ListVoicesResponse",
73+
"MultiSpeakerMarkup",
7274
"StreamingSynthesisInput",
7375
"StreamingSynthesizeConfig",
7476
"StreamingSynthesizeRequest",

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.20.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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
CustomVoiceParams,
3333
ListVoicesRequest,
3434
ListVoicesResponse,
35+
MultiSpeakerMarkup,
3536
SsmlVoiceGender,
3637
StreamingSynthesisInput,
3738
StreamingSynthesizeConfig,
@@ -61,6 +62,7 @@
6162
"CustomVoiceParams",
6263
"ListVoicesRequest",
6364
"ListVoicesResponse",
65+
"MultiSpeakerMarkup",
6466
"SsmlVoiceGender",
6567
"StreamingSynthesisInput",
6668
"StreamingSynthesizeConfig",

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.20.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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
CustomVoiceParams,
2323
ListVoicesRequest,
2424
ListVoicesResponse,
25+
MultiSpeakerMarkup,
2526
SsmlVoiceGender,
2627
StreamingSynthesisInput,
2728
StreamingSynthesizeConfig,
@@ -48,6 +49,7 @@
4849
"CustomVoiceParams",
4950
"ListVoicesRequest",
5051
"ListVoicesResponse",
52+
"MultiSpeakerMarkup",
5153
"StreamingSynthesisInput",
5254
"StreamingSynthesizeConfig",
5355
"StreamingSynthesizeRequest",

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"SynthesizeSpeechRequest",
3232
"CustomPronunciationParams",
3333
"CustomPronunciations",
34+
"MultiSpeakerMarkup",
3435
"SynthesisInput",
3536
"VoiceSelectionParams",
3637
"AudioConfig",
@@ -328,6 +329,42 @@ class CustomPronunciations(proto.Message):
328329
)
329330

330331

332+
class MultiSpeakerMarkup(proto.Message):
333+
r"""A collection of turns for multi-speaker synthesis.
334+
335+
Attributes:
336+
turns (MutableSequence[google.cloud.texttospeech_v1.types.MultiSpeakerMarkup.Turn]):
337+
Required. Speaker turns.
338+
"""
339+
340+
class Turn(proto.Message):
341+
r"""A Multi-speaker turn.
342+
343+
Attributes:
344+
speaker (str):
345+
Required. The speaker of the turn, for
346+
example, 'O' or 'Q'. Please refer to
347+
documentation for available speakers.
348+
text (str):
349+
Required. The text to speak.
350+
"""
351+
352+
speaker: str = proto.Field(
353+
proto.STRING,
354+
number=1,
355+
)
356+
text: str = proto.Field(
357+
proto.STRING,
358+
number=2,
359+
)
360+
361+
turns: MutableSequence[Turn] = proto.RepeatedField(
362+
proto.MESSAGE,
363+
number=1,
364+
message=Turn,
365+
)
366+
367+
331368
class SynthesisInput(proto.Message):
332369
r"""Contains text input to be synthesized. Either ``text`` or ``ssml``
333370
must be supplied. Supplying both or neither returns
@@ -354,6 +391,11 @@ class SynthesisInput(proto.Message):
354391
For more information, see
355392
`SSML <https://cloud.google.com/text-to-speech/docs/ssml>`__.
356393
394+
This field is a member of `oneof`_ ``input_source``.
395+
multi_speaker_markup (google.cloud.texttospeech_v1.types.MultiSpeakerMarkup):
396+
The multi-speaker input to be synthesized.
397+
Only applicable for multi-speaker synthesis.
398+
357399
This field is a member of `oneof`_ ``input_source``.
358400
custom_pronunciations (google.cloud.texttospeech_v1.types.CustomPronunciations):
359401
Optional. The pronunciation customizations to
@@ -383,6 +425,12 @@ class SynthesisInput(proto.Message):
383425
number=2,
384426
oneof="input_source",
385427
)
428+
multi_speaker_markup: "MultiSpeakerMarkup" = proto.Field(
429+
proto.MESSAGE,
430+
number=4,
431+
oneof="input_source",
432+
message="MultiSpeakerMarkup",
433+
)
386434
custom_pronunciations: "CustomPronunciations" = proto.Field(
387435
proto.MESSAGE,
388436
number=3,

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

0 commit comments

Comments
 (0)