https://cloud.google.com/text-to-speech/docs/audio-profiles
To generate an audio file, make a POST
request and provide the appropriate request body. The following shows an example of a POST
request using curl
. The example uses the access token for a service account set up for the project using the Google Cloud Platform Cloud SDK. For instructions on installing the Cloud SDK, setting up a project with a service account, and obtaining an access token, see the Quickstarts.
The following example shows how to send a request to the text:synthesize
endpoint.
If the request is successful, the Text-to-Speech API returns the synthesized audio as base64-encoded data contained in the JSON output. The JSON output in the audio-profiles.txt
file looks like the following:
To decode the results from the Cloud Text-to-Speech API as an MP3 audio file, run the following command from the same directory as the audio-profiles.txt
file.
No hay comentarios:
Publicar un comentario