From bc5172555aff47a43ab5806514fe46f08aa31c9f Mon Sep 17 00:00:00 2001 From: Michelle Casbon Date: Fri, 10 Jan 2020 16:49:10 -0800 Subject: [PATCH] Add voice selection by name [(#2687)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2687) * Add voice selection by name * Add future to requirements.txt Fixes python2 test failures referencing html. Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> --- samples/snippets/requirements.txt | 1 + samples/snippets/synthesize_text.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 0cd0886a..ccf0a4d5 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1,2 @@ +future==0.18.2 google-cloud-texttospeech==0.5.0 diff --git a/samples/snippets/synthesize_text.py b/samples/snippets/synthesize_text.py index d5886bd1..768c0da0 100644 --- a/samples/snippets/synthesize_text.py +++ b/samples/snippets/synthesize_text.py @@ -36,6 +36,7 @@ def synthesize_text(text): # Names of voices can be retrieved with client.list_voices(). voice = texttospeech.types.VoiceSelectionParams( language_code='en-US', + name='en-US-Standard-C', ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) audio_config = texttospeech.types.AudioConfig( @@ -68,6 +69,7 @@ def synthesize_ssml(ssml): # Names of voices can be retrieved with client.list_voices(). voice = texttospeech.types.VoiceSelectionParams( language_code='en-US', + name='en-US-Standard-C', ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) audio_config = texttospeech.types.AudioConfig(