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

Commit

Permalink
docs: add generated snippets (#249)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

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] committed Feb 11, 2022
1 parent 3af8934 commit f918e82
Show file tree
Hide file tree
Showing 14 changed files with 964 additions and 0 deletions.
Expand Up @@ -206,6 +206,24 @@ async def list_voices(
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
.. code-block::
from google.cloud import texttospeech_v1
def sample_list_voices():
# Create a client
client = texttospeech_v1.TextToSpeechClient()
# Initialize request argument(s)
request = texttospeech_v1.ListVoicesRequest(
)
# Make the request
response = client.list_voices(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]):
The request object. The top-level message sent by the
Expand Down Expand Up @@ -281,6 +299,37 @@ async def synthesize_speech(
r"""Synthesizes speech synchronously: receive results
after all text input has been processed.
.. code-block::
from google.cloud import texttospeech_v1
def sample_synthesize_speech():
# Create a client
client = texttospeech_v1.TextToSpeechClient()
# Initialize request argument(s)
input = texttospeech_v1.SynthesisInput()
input.text = "text_value"
voice = texttospeech_v1.VoiceSelectionParams()
voice.language_code = "language_code_value"
audio_config = texttospeech_v1.AudioConfig()
audio_config.audio_encoding = "ALAW"
request = texttospeech_v1.SynthesizeSpeechRequest(
input=input,
voice=voice,
audio_config=audio_config,
)
# Make the request
response = client.synthesize_speech(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]):
The request object. The top-level message sent by the
Expand Down
51 changes: 51 additions & 0 deletions google/cloud/texttospeech_v1/services/text_to_speech/client.py
Expand Up @@ -391,6 +391,25 @@ def list_voices(
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
.. code-block::
from google.cloud import texttospeech_v1
def sample_list_voices():
# Create a client
client = texttospeech_v1.TextToSpeechClient()
# Initialize request argument(s)
request = texttospeech_v1.ListVoicesRequest(
)
# Make the request
response = client.list_voices(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]):
The request object. The top-level message sent by the
Expand Down Expand Up @@ -466,6 +485,38 @@ def synthesize_speech(
r"""Synthesizes speech synchronously: receive results
after all text input has been processed.
.. code-block::
from google.cloud import texttospeech_v1
def sample_synthesize_speech():
# Create a client
client = texttospeech_v1.TextToSpeechClient()
# Initialize request argument(s)
input = texttospeech_v1.SynthesisInput()
input.text = "text_value"
voice = texttospeech_v1.VoiceSelectionParams()
voice.language_code = "language_code_value"
audio_config = texttospeech_v1.AudioConfig()
audio_config.audio_encoding = "ALAW"
request = texttospeech_v1.SynthesizeSpeechRequest(
input=input,
voice=voice,
audio_config=audio_config,
)
# Make the request
response = client.synthesize_speech(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]):
The request object. The top-level message sent by the
Expand Down
Expand Up @@ -208,6 +208,24 @@ async def list_voices(
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
.. code-block::
from google.cloud import texttospeech_v1beta1
def sample_list_voices():
# Create a client
client = texttospeech_v1beta1.TextToSpeechClient()
# Initialize request argument(s)
request = texttospeech_v1beta1.ListVoicesRequest(
)
# Make the request
response = client.list_voices(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1beta1.types.ListVoicesRequest, dict]):
The request object. The top-level message sent by the
Expand Down Expand Up @@ -283,6 +301,37 @@ async def synthesize_speech(
r"""Synthesizes speech synchronously: receive results
after all text input has been processed.
.. code-block::
from google.cloud import texttospeech_v1beta1
def sample_synthesize_speech():
# Create a client
client = texttospeech_v1beta1.TextToSpeechClient()
# Initialize request argument(s)
input = texttospeech_v1beta1.SynthesisInput()
input.text = "text_value"
voice = texttospeech_v1beta1.VoiceSelectionParams()
voice.language_code = "language_code_value"
audio_config = texttospeech_v1beta1.AudioConfig()
audio_config.audio_encoding = "ALAW"
request = texttospeech_v1beta1.SynthesizeSpeechRequest(
input=input,
voice=voice,
audio_config=audio_config,
)
# Make the request
response = client.synthesize_speech(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1beta1.types.SynthesizeSpeechRequest, dict]):
The request object. The top-level message sent by the
Expand Down
Expand Up @@ -407,6 +407,25 @@ def list_voices(
) -> cloud_tts.ListVoicesResponse:
r"""Returns a list of Voice supported for synthesis.
.. code-block::
from google.cloud import texttospeech_v1beta1
def sample_list_voices():
# Create a client
client = texttospeech_v1beta1.TextToSpeechClient()
# Initialize request argument(s)
request = texttospeech_v1beta1.ListVoicesRequest(
)
# Make the request
response = client.list_voices(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1beta1.types.ListVoicesRequest, dict]):
The request object. The top-level message sent by the
Expand Down Expand Up @@ -482,6 +501,38 @@ def synthesize_speech(
r"""Synthesizes speech synchronously: receive results
after all text input has been processed.
.. code-block::
from google.cloud import texttospeech_v1beta1
def sample_synthesize_speech():
# Create a client
client = texttospeech_v1beta1.TextToSpeechClient()
# Initialize request argument(s)
input = texttospeech_v1beta1.SynthesisInput()
input.text = "text_value"
voice = texttospeech_v1beta1.VoiceSelectionParams()
voice.language_code = "language_code_value"
audio_config = texttospeech_v1beta1.AudioConfig()
audio_config.audio_encoding = "ALAW"
request = texttospeech_v1beta1.SynthesizeSpeechRequest(
input=input,
voice=voice,
audio_config=audio_config,
)
# Make the request
response = client.synthesize_speech(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.texttospeech_v1beta1.types.SynthesizeSpeechRequest, dict]):
The request object. The top-level message sent by the
Expand Down

0 comments on commit f918e82

Please sign in to comment.