Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
docs: Add documentation for enums (#355)
Browse files Browse the repository at this point in the history
* docs: Add documentation for enums

fix: Add context manager return types

chore: Update gapic-generator-python to v1.8.1
PiperOrigin-RevId: 503210727

Source-Link: googleapis/googleapis@a391fd1

Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

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 Jan 20, 2023
1 parent 65e07fa commit 6415162
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def sample_synthesize_speech():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "TextToSpeechClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def sample_synthesize_long_audio():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
58 changes: 58 additions & 0 deletions google/cloud/texttospeech_v1/types/cloud_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@
class SsmlVoiceGender(proto.Enum):
r"""Gender of the voice as described in `SSML voice
element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`__.
Values:
SSML_VOICE_GENDER_UNSPECIFIED (0):
An unspecified gender.
In VoiceSelectionParams, this means that the
client doesn't care which gender the selected
voice will have. In the Voice field of
ListVoicesResponse, this may mean that the voice
doesn't fit any of the other categories in this
enum, or that the gender of the voice isn't
known.
MALE (1):
A male voice.
FEMALE (2):
A female voice.
NEUTRAL (3):
A gender-neutral voice. This voice is not yet
supported.
"""
SSML_VOICE_GENDER_UNSPECIFIED = 0
MALE = 1
Expand All @@ -48,6 +66,32 @@ class SsmlVoiceGender(proto.Enum):
class AudioEncoding(proto.Enum):
r"""Configuration to set up audio encoder. The encoding
determines the output audio format that we'd like.
Values:
AUDIO_ENCODING_UNSPECIFIED (0):
Not specified. Will return result
[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
LINEAR16 (1):
Uncompressed 16-bit signed little-endian
samples (Linear PCM). Audio content returned as
LINEAR16 also contains a WAV header.
MP3 (2):
MP3 audio at 32kbps.
OGG_OPUS (3):
Opus encoded audio wrapped in an ogg
container. The result will be a file which can
be played natively on Android, and in browsers
(at least Chrome and Firefox). The quality of
the encoding is considerably higher than MP3
while using approximately the same bitrate.
MULAW (5):
8-bit samples that compand 14-bit audio
samples using G.711 PCMU/mu-law. Audio content
returned as MULAW also contains a WAV header.
ALAW (6):
8-bit samples that compand 14-bit audio
samples using G.711 PCMU/A-law. Audio content
returned as ALAW also contains a WAV header.
"""
AUDIO_ENCODING_UNSPECIFIED = 0
LINEAR16 = 1
Expand Down Expand Up @@ -353,6 +397,20 @@ class ReportedUsage(proto.Enum):
r"""The usage of the synthesized audio. You must report your
honest and correct usage of the service as it's regulated by
contract and will cause significant difference in billing.
Values:
REPORTED_USAGE_UNSPECIFIED (0):
Request with reported usage unspecified will
be rejected.
REALTIME (1):
For scenarios where the synthesized audio is
not downloadable and can only be used once. For
example, real-time request in IVR system.
OFFLINE (2):
For scenarios where the synthesized audio is
downloadable and can be reused. For example, the
synthesized audio is downloaded, stored in
customer service system and played repeatedly.
"""
REPORTED_USAGE_UNSPECIFIED = 0
REALTIME = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def sample_synthesize_speech():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "TextToSpeechClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def sample_synthesize_long_audio():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "TextToSpeechLongAudioSynthesizeClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
68 changes: 68 additions & 0 deletions google/cloud/texttospeech_v1beta1/types/cloud_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
class SsmlVoiceGender(proto.Enum):
r"""Gender of the voice as described in `SSML voice
element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`__.
Values:
SSML_VOICE_GENDER_UNSPECIFIED (0):
An unspecified gender.
In VoiceSelectionParams, this means that the
client doesn't care which gender the selected
voice will have. In the Voice field of
ListVoicesResponse, this may mean that the voice
doesn't fit any of the other categories in this
enum, or that the gender of the voice isn't
known.
MALE (1):
A male voice.
FEMALE (2):
A female voice.
NEUTRAL (3):
A gender-neutral voice. This voice is not yet
supported.
"""
SSML_VOICE_GENDER_UNSPECIFIED = 0
MALE = 1
Expand All @@ -49,6 +67,34 @@ class SsmlVoiceGender(proto.Enum):
class AudioEncoding(proto.Enum):
r"""Configuration to set up audio encoder. The encoding
determines the output audio format that we'd like.
Values:
AUDIO_ENCODING_UNSPECIFIED (0):
Not specified. Will return result
[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
LINEAR16 (1):
Uncompressed 16-bit signed little-endian
samples (Linear PCM). Audio content returned as
LINEAR16 also contains a WAV header.
MP3 (2):
MP3 audio at 32kbps.
MP3_64_KBPS (4):
MP3 at 64kbps.
OGG_OPUS (3):
Opus encoded audio wrapped in an ogg
container. The result will be a file which can
be played natively on Android, and in browsers
(at least Chrome and Firefox). The quality of
the encoding is considerably higher than MP3
while using approximately the same bitrate.
MULAW (5):
8-bit samples that compand 14-bit audio
samples using G.711 PCMU/mu-law. Audio content
returned as MULAW also contains a WAV header.
ALAW (6):
8-bit samples that compand 14-bit audio
samples using G.711 PCMU/A-law. Audio content
returned as ALAW also contains a WAV header.
"""
AUDIO_ENCODING_UNSPECIFIED = 0
LINEAR16 = 1
Expand Down Expand Up @@ -156,6 +202,14 @@ class SynthesizeSpeechRequest(proto.Message):
class TimepointType(proto.Enum):
r"""The type of timepoint information that is returned in the
response.
Values:
TIMEPOINT_TYPE_UNSPECIFIED (0):
Not specified. No timepoint information will
be returned.
SSML_MARK (1):
Timepoint information of ``<mark>`` tags in SSML input will
be returned.
"""
TIMEPOINT_TYPE_UNSPECIFIED = 0
SSML_MARK = 1
Expand Down Expand Up @@ -370,6 +424,20 @@ class ReportedUsage(proto.Enum):
r"""The usage of the synthesized audio. You must report your
honest and correct usage of the service as it's regulated by
contract and will cause significant difference in billing.
Values:
REPORTED_USAGE_UNSPECIFIED (0):
Request with reported usage unspecified will
be rejected.
REALTIME (1):
For scenarios where the synthesized audio is
not downloadable and can only be used once. For
example, real-time request in IVR system.
OFFLINE (2):
For scenarios where the synthesized audio is
downloadable and can be reused. For example, the
synthesized audio is downloaded, stored in
customer service system and played repeatedly.
"""
REPORTED_USAGE_UNSPECIFIED = 0
REALTIME = 1
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.14.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.14.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 6415162

Please sign in to comment.