This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36a17cc
commit 89994cb
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
|
||
<!-- WIP, to be moved to google-cloud-python repository ---> | ||
|
||
# Method Calls | ||
|
||
Methods now expect request objects. We provide a script that will convert most common cases automatically. | ||
|
||
1. Install the library | ||
|
||
```py | ||
python3 -m pip install google-cloud-text-to-speech | ||
``` | ||
|
||
2. `fixup_keywords.py` is shipped with the library. The script expects | ||
an input directory (with the code to convert) and an empty destination directory. | ||
|
||
```sh | ||
$ fixup_keywords.py --input-directory .samples/ --output-directory samples/ | ||
``` | ||
|
||
Before: | ||
```py | ||
from google.cloud import texttospeech | ||
|
||
client = texttospeech.TextToSpeechClient() | ||
|
||
voices = client.list_voices(language_code="no") | ||
``` | ||
|
||
After: | ||
```py | ||
from google.cloud import texttospeech | ||
|
||
client = texttospeech.TextToSpeechClient() | ||
|
||
voices = client.list_voices(request={"language_code": "no"}) | ||
``` | ||
|
||
# Location of Types and Enums | ||
|
||
Types and Enums are available at the top level. | ||
|
||
Before: | ||
```py | ||
|
||
from google.cloud import texttospeech | ||
|
||
voice = texttospeech.types.VoiceSelectionParams(language_code="en-US") | ||
encoding = texttospeechAudioEncoding.MP3 | ||
``` | ||
|
||
|
||
After: | ||
```py | ||
from google.cloud import texttospeech | ||
|
||
voice = texttospeech.VoiceSelectionParams(language_code="en-US") | ||
encoding = texttospeech.AudioEncoding.MP3 | ||
``` |