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

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 13, 2020
1 parent bbcf6c4 commit e84e022
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
future==0.18.2
google-cloud-texttospeech==0.5.0
2 changes: 2 additions & 0 deletions samples/synthesize_text.py
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 e84e022

Please sign in to comment.