Skip to content

Commit

Permalink
feat: [google-cloud-texttospeech] add multi-speaker markup, which all…
Browse files Browse the repository at this point in the history
…ows generating dialogue between multiple speakers (#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:
googleapis/googleapis-gen@a2253a0
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiYTIyNTNhMDFlNmU5M2U3OWExZGVjN2UwYjJhZWVhNzA4YjYzNGQxZSJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 28, 2024
1 parent 8ca6f2c commit b01d99d
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
CustomVoiceParams,
ListVoicesRequest,
ListVoicesResponse,
MultiSpeakerMarkup,
SsmlVoiceGender,
StreamingSynthesisInput,
StreamingSynthesizeConfig,
Expand Down Expand Up @@ -69,6 +70,7 @@
"CustomVoiceParams",
"ListVoicesRequest",
"ListVoicesResponse",
"MultiSpeakerMarkup",
"StreamingSynthesisInput",
"StreamingSynthesizeConfig",
"StreamingSynthesizeRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.20.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
CustomVoiceParams,
ListVoicesRequest,
ListVoicesResponse,
MultiSpeakerMarkup,
SsmlVoiceGender,
StreamingSynthesisInput,
StreamingSynthesizeConfig,
Expand Down Expand Up @@ -61,6 +62,7 @@
"CustomVoiceParams",
"ListVoicesRequest",
"ListVoicesResponse",
"MultiSpeakerMarkup",
"SsmlVoiceGender",
"StreamingSynthesisInput",
"StreamingSynthesizeConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.20.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CustomVoiceParams,
ListVoicesRequest,
ListVoicesResponse,
MultiSpeakerMarkup,
SsmlVoiceGender,
StreamingSynthesisInput,
StreamingSynthesizeConfig,
Expand All @@ -48,6 +49,7 @@
"CustomVoiceParams",
"ListVoicesRequest",
"ListVoicesResponse",
"MultiSpeakerMarkup",
"StreamingSynthesisInput",
"StreamingSynthesizeConfig",
"StreamingSynthesizeRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"SynthesizeSpeechRequest",
"CustomPronunciationParams",
"CustomPronunciations",
"MultiSpeakerMarkup",
"SynthesisInput",
"VoiceSelectionParams",
"AudioConfig",
Expand Down Expand Up @@ -328,6 +329,42 @@ class CustomPronunciations(proto.Message):
)


class MultiSpeakerMarkup(proto.Message):
r"""A collection of turns for multi-speaker synthesis.
Attributes:
turns (MutableSequence[google.cloud.texttospeech_v1.types.MultiSpeakerMarkup.Turn]):
Required. Speaker turns.
"""

class Turn(proto.Message):
r"""A Multi-speaker turn.
Attributes:
speaker (str):
Required. The speaker of the turn, for
example, 'O' or 'Q'. Please refer to
documentation for available speakers.
text (str):
Required. The text to speak.
"""

speaker: str = proto.Field(
proto.STRING,
number=1,
)
text: str = proto.Field(
proto.STRING,
number=2,
)

turns: MutableSequence[Turn] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message=Turn,
)


class SynthesisInput(proto.Message):
r"""Contains text input to be synthesized. Either ``text`` or ``ssml``
must be supplied. Supplying both or neither returns
Expand All @@ -354,6 +391,11 @@ class SynthesisInput(proto.Message):
For more information, see
`SSML <https://cloud.google.com/text-to-speech/docs/ssml>`__.
This field is a member of `oneof`_ ``input_source``.
multi_speaker_markup (google.cloud.texttospeech_v1.types.MultiSpeakerMarkup):
The multi-speaker input to be synthesized.
Only applicable for multi-speaker synthesis.
This field is a member of `oneof`_ ``input_source``.
custom_pronunciations (google.cloud.texttospeech_v1.types.CustomPronunciations):
Optional. The pronunciation customizations to
Expand Down Expand Up @@ -383,6 +425,12 @@ class SynthesisInput(proto.Message):
number=2,
oneof="input_source",
)
multi_speaker_markup: "MultiSpeakerMarkup" = proto.Field(
proto.MESSAGE,
number=4,
oneof="input_source",
message="MultiSpeakerMarkup",
)
custom_pronunciations: "CustomPronunciations" = proto.Field(
proto.MESSAGE,
number=3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.20.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-texttospeech",
"version": "2.20.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-texttospeech",
"version": "2.20.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit b01d99d

Please sign in to comment.