Skip to content

Add files via upload #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions _posts/2020-06-30-Google-S2T-T2S-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,48 @@ Welcome to the API Reference Guide for Google Speech2Text and Text2Speech.

NOTE: If you've already created a project and service account, you may skip this step. For wodoto's case, our project is "vector-control", and service account is "scazlab-wodoto".

Navigate to https://console.cloud.google.com/home, making sure to sign into the Scazlab gmail account. From here, click "select a project" on the top-left. Name your project and leave organization blank. Next, navigate to https://console.cloud.google.com/apis. Make sure to select your newly-created project from the top-left dropdown menu. Select "Library" from the left navigation bar, search for the API you'd like to use, select it and click "ENABLE." This will take some time to load. In wodoto's case, we're using "Cloud Text-to-Speech API" and "Cloud Speech-to-Text API."
Navigate to [https://console.cloud.google.com/apis](https://console.cloud.google.com/apis), making sure to sign into the Scazlab gmail account. From here, click "select a project" on the top-left, and choose "NEW PROJECT." Name your project and leave organization blank. Make sure to select your newly-created project from the same menu once it's been created.
![Step 1 image](https://github.com/ScazLab/ScazLab.github.io/tree/master/images/setup-guide-1.png)

Once you've added all the APIs, again from the left navigation bar select "Credentials." Then, click on "Create Credentials, select "Create service account," give it a name, an optional description, and hit "CREATE." On the next page, give it the role "Owner," and then keep hitting "NEXT" until the service account has been created.
Select "Library" from the left navigation bar, search for the API you'd like to use, select it and click "ENABLE." This will take some time to load. For speech2text and text2speech, we're using "Cloud Text-to-Speech API" and "Cloud Speech-to-Text API."

Once you've added all the APIs, again from the left navigation bar select "Credentials." Then, click on "Create Credentials, select "Create service account," give it a name, an optional description, and hit "CREATE."

![Step 2 image](https://github.com/ScazLab/ScazLab.github.io/tree/master/images/setup-guide-3.png)

On the next page, give it the role "Owner," and then keep hitting "NEXT" until the service account has been created.

## Setting up the GCloud key.
Make sure to have your project selected from the top-left menu, and to be logged into the Scazlab gmail account. Find your service account on the "Credentials" tab at https://console.cloud.google.com/apis, under "Service Accounts." Select it, scroll down, and click on "ADD KEY," then "Create new key", and select the type to be JSON. Your browser should then prompt you to download a .json file.
Make sure to have your project selected from the top-left menu, and to be logged into the Scazlab gmail account. Find your service account on the "Credentials" tab at [https://console.cloud.google.com/apis](https://console.cloud.google.com/apis), under "Service Accounts." Select it, scroll down, and click on "ADD KEY," then "Create new key", and select the type to be JSON.

![Step 3 image](https://github.com/ScazLab/ScazLab.github.io/tree/master/images/setup-guide-5.png)

Your browser should then prompt you to download a .json file.

Copy the downloaded file in into your repository, or anywhere else on your system, and set the environment variable GOOGLE_APPLICATION_CREDENTIALS by running `export GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>`. If you don't want to set this every time you open bash, consider:
- Adding the environment variable to your .bashrc so that it's automatically set every session by running `echo "export GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>" >> ~/.bashrc`
- Add it to your ROS launch file with the tag `<env name="GOOGLE_APPLICATION_CREDENTIALS" value="<path-to-json>" />`
- Add it to your Dockerfile with the line `ENV GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>`
Copy the downloaded file in into your repository, or anywhere else on your system, and set the environment variable GOOGLE_APPLICATION_CREDENTIALS by running
export GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>
If you don't want to set this every time you open bash, consider:
- Adding the environment variable to your .bashrc so that it's automatically set every session by running
echo "export GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>" >> ~/.bashrc
- Add it to your ROS launch file with the tag
<env name="GOOGLE_APPLICATION_CREDENTIALS" value="<path-to-json>" />
- Add it to your Dockerfile with the line
ENV GOOGLE_APPLICATION_CREDENTIALS=<path-to-json>

In either case, congratulations! You should now be able to interact with Google's APIs.


## Documentation & Examples

- [Speech-to-Text quickstart guide](https://cloud.google.com/speech-to-text/docs/quickstart)
- [Text-to-Speech quickstart guide](https://cloud.google.com/text-to-speech/docs/quickstarts)
- [Transcribing streaming guide](https://cloud.google.com/speech-to-text/docs/streaming-recognize)

- [Speech transcription examples](https://github.com/googleapis/python-speech/tree/master/samples/v1)
- [Transcribe streaming example](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/cloud-client/transcribe_streaming.py)






Expand Down
Binary file added images/setup-guide-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/setup-guide-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/setup-guide-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/setup-guide-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/setup-guide-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.