Skip to content

Commit

Permalink
Add voice selection by name [(#2687)](GoogleCloudPlatform/python-docs…
Browse files Browse the repository at this point in the history
…-samples#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>
  • Loading branch information
2 people authored and busunkim96 committed May 20, 2020
1 parent 3cf6672 commit 7ab33c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
future==0.18.2
google-cloud-texttospeech==0.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7ab33c9

Please sign in to comment.