Skip to content

By using the Python Client Library, we can convert any Text-to-Speech using the Google Cloud Text-to-Speech API. This implementation had been structured and made easy through this project.

License

Notifications You must be signed in to change notification settings

Som23Git/GCP-TTS-API-and-Python-Script

Repository files navigation

Text-to-Speech Setup using the GCP Cloud API with Python Client

GCP TTS Python API
GCP_small TTS_small Python_small API_small

* For Easy Installation - Execute the Script File

autoexecute.sh

This autoexecute.sh script file does all your work for preinstallation and text-to-speech processing. Just follow the steps and confirm your environment is setup appropriately.


* Implementation

It is a straight-forward implementation, you should make sure to use the Gcloud Libraries and Packages to create an fail-free enivironment.

+ Checklists
  • gcloud -v
  • python3 -V
  • pip3 -V
  • GCP Account

Just download the package and start the Python Command to kickstart your experience in the Text-To-Speech.


* To setup the GCP environment in local, start with the below command in the local Terminal

gcloud init

Make sure you create a service account and download the service-account.json key and export it as an GOOGLE_APPLICATION_CREDENTIALS.


* Github Source:

* GCP Documentation:


* Prerequisite Commands in Google Codelabs:


* Read SSML from Text File

synthesize_text_file(text_file);

This function will fetch the input_file.txt from the input arguments and will send it to GCP instance that you have instantiated. Once, it is processed, you'll get a output.mp3 file.

To pass the arguments and to run the Python Script

python3 synthesize_file.py --text input_file.txt

* Read SSML from SSML File

synthesize_text_file(ssml_file);

It is similar to the above text file. This function will fetch the input_file.ssml from the input arguments and will send it to GCP instance that you have instantiated. Once, it is processed, you'll get a output.mp3 file.

To pass the arguments and to run the Python Script

python3 synthesize_file.py --ssml input_file.ssml

* Follow For More:

@somesh-rokz

Thanks for checking this out!! ❤️

About

By using the Python Client Library, we can convert any Text-to-Speech using the Google Cloud Text-to-Speech API. This implementation had been structured and made easy through this project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published