Google Text-to-Speech (TTS) Settings

How to Setup Google Text-to-Speech (TTS) Settings

Create a Service Account on Google Cloud To interact with the Text-to-speech API, you are required to create a service account in the cloud console. Follow the steps below. You can also get instructions on this page.

On Google Cloud Platform (For Developers):

  1. Set Up a Google Cloud Platform Project:

    • Log in to your Google Cloud Platform (GCP) account. In the Cloud Console, go to the Create service account page.

    • Create a new project or use an existing one.

  2. Enable Text-to-Speech API:

    • Go to the GCP Console and navigate to the API & Services > Library.

    • Search for "Text-to-Speech API" and enable it for your project.

  3. Create Service Account and Obtain Credentials:

    • Create a service account for your project and download the JSON file containing the credentials.

    • This JSON file will be used to authenticate your application when using the Text-to-Speech API.

  4. Use the API:

    • Implement the Text-to-Speech API in your code by using the provided credentials and API endpoints.

    • Refer to Google's official documentation and code samples for guidance on using the Text-to-Speech API.

Next, set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of this downloaded JSON file.

GOOGLE_APPLICATION_CREDENTIALS=/home/user_name/public_html/project-name/public/googletts/client_secret.json

Last updated