Skip to content

Commit ef9dd47

Browse files
authored
Generate text-to-speech v1 and v1beta1 (googleapis#5468)
1 parent 06af709 commit ef9dd47

File tree

22 files changed

+1528
-250
lines changed

22 files changed

+1528
-250
lines changed

texttospeech/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Python Client for Cloud Text-to-Speech API (`Alpha`_)
22
=====================================================
33

4-
`Cloud Text-to-Speech API`_: Cloud Text-to-Speech API.
4+
`Cloud Text-to-Speech API`_: Synthesizes natural-sounding speech by applying powerful neural network
5+
models.
56

67
- `Client Library Documentation`_
78
- `Product Documentation`_

texttospeech/docs/gapic/v1/api.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Client for Cloud Text-to-Speech API
2+
===================================
3+
4+
.. automodule:: google.cloud.texttospeech_v1
5+
:members:
6+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Types for Cloud Text-to-Speech API Client
2+
=========================================
3+
4+
.. automodule:: google.cloud.texttospeech_v1.types
5+
:members:

texttospeech/docs/index.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Python Client for Cloud Text-to-Speech API (`Alpha`_)
22
=====================================================
33

4-
`Cloud Text-to-Speech API`_: Cloud Text-to-Speech API.
4+
`Cloud Text-to-Speech API`_: Synthesizes natural-sounding speech by applying powerful neural network
5+
models.
56

67
- `Client Library Documentation`_
78
- `Product Documentation`_
@@ -79,6 +80,8 @@ Api Reference
7980
.. toctree::
8081
:maxdepth: 2
8182

83+
gapic/v1/api
84+
gapic/v1/types
8285
gapic/v1beta1/api
8386
gapic/v1beta1/types
84-
changelog
87+
changelog

texttospeech/google/cloud/texttospeech.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
from __future__ import absolute_import
1616

17-
from google.cloud.texttospeech_v1beta1 import TextToSpeechClient
18-
from google.cloud.texttospeech_v1beta1 import enums
19-
from google.cloud.texttospeech_v1beta1 import types
17+
from google.cloud.texttospeech_v1 import TextToSpeechClient
18+
from google.cloud.texttospeech_v1 import enums
19+
from google.cloud.texttospeech_v1 import types
2020

2121
__all__ = (
2222
'enums',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from __future__ import absolute_import
16+
17+
from google.cloud.texttospeech_v1 import types
18+
from google.cloud.texttospeech_v1.gapic import enums
19+
from google.cloud.texttospeech_v1.gapic import text_to_speech_client
20+
21+
22+
class TextToSpeechClient(text_to_speech_client.TextToSpeechClient):
23+
__doc__ = text_to_speech_client.TextToSpeechClient.__doc__
24+
enums = enums
25+
26+
27+
__all__ = (
28+
'enums',
29+
'types',
30+
'TextToSpeechClient',
31+
)

texttospeech/google/cloud/texttospeech_v1/gapic/__init__.py

Whitespace-only changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Wrappers for protocol buffer enum types."""
15+
16+
import enum
17+
18+
19+
class SsmlVoiceGender(enum.IntEnum):
20+
"""
21+
Gender of the voice as described in
22+
`SSML voice element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`_.
23+
24+
Attributes:
25+
SSML_VOICE_GENDER_UNSPECIFIED (int): An unspecified gender.
26+
In VoiceSelectionParams, this means that the client doesn't care which
27+
gender the selected voice will have. In the Voice field of
28+
ListVoicesResponse, this may mean that the voice doesn't fit any of the
29+
other categories in this enum, or that the gender of the voice isn't known.
30+
MALE (int): A male voice.
31+
FEMALE (int): A female voice.
32+
NEUTRAL (int): A gender-neutral voice.
33+
"""
34+
SSML_VOICE_GENDER_UNSPECIFIED = 0
35+
MALE = 1
36+
FEMALE = 2
37+
NEUTRAL = 3
38+
39+
40+
class AudioEncoding(enum.IntEnum):
41+
"""
42+
Configuration to set up audio encoder. The encoding determines the output
43+
audio format that we'd like.
44+
45+
Attributes:
46+
AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``.
47+
LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM).
48+
Audio content returned as LINEAR16 also contains a WAV header.
49+
MP3 (int): MP3 audio.
50+
OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a
51+
file which can be played natively on Android, and in browsers (at least
52+
Chrome and Firefox). The quality of the encoding is considerably higher
53+
than MP3 while using approximately the same bitrate.
54+
"""
55+
AUDIO_ENCODING_UNSPECIFIED = 0
56+
LINEAR16 = 1
57+
MP3 = 2
58+
OGG_OPUS = 3

0 commit comments

Comments
 (0)