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

Commit f918e82

Browse files
docs: add generated snippets (#249)
* chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde 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>
1 parent 3af8934 commit f918e82

14 files changed

+964
-0
lines changed

google/cloud/texttospeech_v1/services/text_to_speech/async_client.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,24 @@ async def list_voices(
206206
) -> cloud_tts.ListVoicesResponse:
207207
r"""Returns a list of Voice supported for synthesis.
208208
209+
.. code-block::
210+
211+
from google.cloud import texttospeech_v1
212+
213+
def sample_list_voices():
214+
# Create a client
215+
client = texttospeech_v1.TextToSpeechClient()
216+
217+
# Initialize request argument(s)
218+
request = texttospeech_v1.ListVoicesRequest(
219+
)
220+
221+
# Make the request
222+
response = client.list_voices(request=request)
223+
224+
# Handle the response
225+
print(response)
226+
209227
Args:
210228
request (Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]):
211229
The request object. The top-level message sent by the
@@ -281,6 +299,37 @@ async def synthesize_speech(
281299
r"""Synthesizes speech synchronously: receive results
282300
after all text input has been processed.
283301
302+
303+
.. code-block::
304+
305+
from google.cloud import texttospeech_v1
306+
307+
def sample_synthesize_speech():
308+
# Create a client
309+
client = texttospeech_v1.TextToSpeechClient()
310+
311+
# Initialize request argument(s)
312+
input = texttospeech_v1.SynthesisInput()
313+
input.text = "text_value"
314+
315+
voice = texttospeech_v1.VoiceSelectionParams()
316+
voice.language_code = "language_code_value"
317+
318+
audio_config = texttospeech_v1.AudioConfig()
319+
audio_config.audio_encoding = "ALAW"
320+
321+
request = texttospeech_v1.SynthesizeSpeechRequest(
322+
input=input,
323+
voice=voice,
324+
audio_config=audio_config,
325+
)
326+
327+
# Make the request
328+
response = client.synthesize_speech(request=request)
329+
330+
# Handle the response
331+
print(response)
332+
284333
Args:
285334
request (Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]):
286335
The request object. The top-level message sent by the

google/cloud/texttospeech_v1/services/text_to_speech/client.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,25 @@ def list_voices(
391391
) -> cloud_tts.ListVoicesResponse:
392392
r"""Returns a list of Voice supported for synthesis.
393393
394+
395+
.. code-block::
396+
397+
from google.cloud import texttospeech_v1
398+
399+
def sample_list_voices():
400+
# Create a client
401+
client = texttospeech_v1.TextToSpeechClient()
402+
403+
# Initialize request argument(s)
404+
request = texttospeech_v1.ListVoicesRequest(
405+
)
406+
407+
# Make the request
408+
response = client.list_voices(request=request)
409+
410+
# Handle the response
411+
print(response)
412+
394413
Args:
395414
request (Union[google.cloud.texttospeech_v1.types.ListVoicesRequest, dict]):
396415
The request object. The top-level message sent by the
@@ -466,6 +485,38 @@ def synthesize_speech(
466485
r"""Synthesizes speech synchronously: receive results
467486
after all text input has been processed.
468487
488+
489+
490+
.. code-block::
491+
492+
from google.cloud import texttospeech_v1
493+
494+
def sample_synthesize_speech():
495+
# Create a client
496+
client = texttospeech_v1.TextToSpeechClient()
497+
498+
# Initialize request argument(s)
499+
input = texttospeech_v1.SynthesisInput()
500+
input.text = "text_value"
501+
502+
voice = texttospeech_v1.VoiceSelectionParams()
503+
voice.language_code = "language_code_value"
504+
505+
audio_config = texttospeech_v1.AudioConfig()
506+
audio_config.audio_encoding = "ALAW"
507+
508+
request = texttospeech_v1.SynthesizeSpeechRequest(
509+
input=input,
510+
voice=voice,
511+
audio_config=audio_config,
512+
)
513+
514+
# Make the request
515+
response = client.synthesize_speech(request=request)
516+
517+
# Handle the response
518+
print(response)
519+
469520
Args:
470521
request (Union[google.cloud.texttospeech_v1.types.SynthesizeSpeechRequest, dict]):
471522
The request object. The top-level message sent by the

google/cloud/texttospeech_v1beta1/services/text_to_speech/async_client.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,24 @@ async def list_voices(
208208
) -> cloud_tts.ListVoicesResponse:
209209
r"""Returns a list of Voice supported for synthesis.
210210
211+
.. code-block::
212+
213+
from google.cloud import texttospeech_v1beta1
214+
215+
def sample_list_voices():
216+
# Create a client
217+
client = texttospeech_v1beta1.TextToSpeechClient()
218+
219+
# Initialize request argument(s)
220+
request = texttospeech_v1beta1.ListVoicesRequest(
221+
)
222+
223+
# Make the request
224+
response = client.list_voices(request=request)
225+
226+
# Handle the response
227+
print(response)
228+
211229
Args:
212230
request (Union[google.cloud.texttospeech_v1beta1.types.ListVoicesRequest, dict]):
213231
The request object. The top-level message sent by the
@@ -283,6 +301,37 @@ async def synthesize_speech(
283301
r"""Synthesizes speech synchronously: receive results
284302
after all text input has been processed.
285303
304+
305+
.. code-block::
306+
307+
from google.cloud import texttospeech_v1beta1
308+
309+
def sample_synthesize_speech():
310+
# Create a client
311+
client = texttospeech_v1beta1.TextToSpeechClient()
312+
313+
# Initialize request argument(s)
314+
input = texttospeech_v1beta1.SynthesisInput()
315+
input.text = "text_value"
316+
317+
voice = texttospeech_v1beta1.VoiceSelectionParams()
318+
voice.language_code = "language_code_value"
319+
320+
audio_config = texttospeech_v1beta1.AudioConfig()
321+
audio_config.audio_encoding = "ALAW"
322+
323+
request = texttospeech_v1beta1.SynthesizeSpeechRequest(
324+
input=input,
325+
voice=voice,
326+
audio_config=audio_config,
327+
)
328+
329+
# Make the request
330+
response = client.synthesize_speech(request=request)
331+
332+
# Handle the response
333+
print(response)
334+
286335
Args:
287336
request (Union[google.cloud.texttospeech_v1beta1.types.SynthesizeSpeechRequest, dict]):
288337
The request object. The top-level message sent by the

google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,25 @@ def list_voices(
407407
) -> cloud_tts.ListVoicesResponse:
408408
r"""Returns a list of Voice supported for synthesis.
409409
410+
411+
.. code-block::
412+
413+
from google.cloud import texttospeech_v1beta1
414+
415+
def sample_list_voices():
416+
# Create a client
417+
client = texttospeech_v1beta1.TextToSpeechClient()
418+
419+
# Initialize request argument(s)
420+
request = texttospeech_v1beta1.ListVoicesRequest(
421+
)
422+
423+
# Make the request
424+
response = client.list_voices(request=request)
425+
426+
# Handle the response
427+
print(response)
428+
410429
Args:
411430
request (Union[google.cloud.texttospeech_v1beta1.types.ListVoicesRequest, dict]):
412431
The request object. The top-level message sent by the
@@ -482,6 +501,38 @@ def synthesize_speech(
482501
r"""Synthesizes speech synchronously: receive results
483502
after all text input has been processed.
484503
504+
505+
506+
.. code-block::
507+
508+
from google.cloud import texttospeech_v1beta1
509+
510+
def sample_synthesize_speech():
511+
# Create a client
512+
client = texttospeech_v1beta1.TextToSpeechClient()
513+
514+
# Initialize request argument(s)
515+
input = texttospeech_v1beta1.SynthesisInput()
516+
input.text = "text_value"
517+
518+
voice = texttospeech_v1beta1.VoiceSelectionParams()
519+
voice.language_code = "language_code_value"
520+
521+
audio_config = texttospeech_v1beta1.AudioConfig()
522+
audio_config.audio_encoding = "ALAW"
523+
524+
request = texttospeech_v1beta1.SynthesizeSpeechRequest(
525+
input=input,
526+
voice=voice,
527+
audio_config=audio_config,
528+
)
529+
530+
# Make the request
531+
response = client.synthesize_speech(request=request)
532+
533+
# Handle the response
534+
print(response)
535+
485536
Args:
486537
request (Union[google.cloud.texttospeech_v1beta1.types.SynthesizeSpeechRequest, dict]):
487538
The request object. The top-level message sent by the

0 commit comments

Comments
 (0)