Google API Text-to-speech


Uploading: 1.jpg…


hi friends, follow all the guidelines here, everything seems to be ok, but this error does not allow me to follow. can anybody help me? Thanks.

I noticed your “Values” in the API call are empty… You should always put a generic value on them (what you will substitute later)

maybe that’s just it


Uploading: 4.png…

I’ve tried with filled values ​​and unfortunately returns the same problem.
Look

I think it’s missing a } at the end of the Body JSON

I added, on line 14, the same error continues…

there is NO COMMA after the text
Capturar

1 Like

I also saw that your call is type “Action”, it should be type “Data” (Use as Data)

1 Like

SOLVED: It was the “Access token endpoint” link it was wrong (it was ending with “auth” and it’s supposed to end with “token”)

1 Like

Yep indeed @ri_scc_94, your guidance solved my integration. Thank you very much.

Since I’m not an expert in API integration, I’m not able to use it. It seemed to me that it was simple, that it was only necessary to insert the dynamic text in the field (as in the image). Using the “Action” type, this action appears in the workflow flow.

Using the Data type as suggested by @ri_scc_94, he integration went perfectly but the flow action doesn’t exist. How to use it in these conditions or if it’s Action type should I install an audio player plugin? Thanks

1 Like

exactly, you should install a Audio Player plugin. Every time you want to play the sound, just play it.

1 Like

Agora consegui! kkkkk Demais. Obrigado.

1 Like

Hello guys! I need to be able to generate an audio file from the google tts api i’ve integrated thanks to the information i found in this tread.

That would be good both to:

  • save it in the database as a file
  • or to call some external API to process and download the file.

Anybody knows how to do it? Thanks!

I know you can download the mp3 file with a plugin (I’m using “Download a file”)

image

To save it in database, you can use the audio64 code that the API call will generate, but to save it in mp3 I’m not sure how you could do it…

2 Likes

Awesome! Thanks a lot @ri_scc_94 !!! That saved me a lot of time :smiley:

1 Like

So, I found out that with audioEncoding “LINEAR16” besides creating a better sound, generates a .wav file, and it sometimes bugs, like stutters… so you should use a “MP3” audioEncoding

As how to play it, this long string of text is the audio in “base64” format, so there’s a trick to convert it easily to mp3, just adding before the base64 code the text:

data:audio/mp3;base64,
image

this way, any audio plugin can play it… but if you’re looking for a free plugin and you don’t need to get a decimal time, I recommend you the “Audio Custom Player”

1 Like

Hi all!

A bit of a dumb question, but Google’s docs are so confusing to navigate. Where do I get the Iss account email and private key?

Thanks!
Jacob

Awesome, thanks! I know this is an old post, but im wondering how you realized that this could be a possible solution? Why does it work - What does it do? Does it convert the string to an mp3 file? I am trying to understand this, in order to perhaps use the logic behind it in future circumstances. Thanks.

No problem! This does not convert the string into an Mp3 file - the string is already in an mp3 format for this solution. If you took an mp3 file, and opened it up with a text editor, you would see an incomprehensible (and long) string of random looking letters. This is basically attaching those letters to the data URL, which contains the information telling the audio player what to play. I can’t remember how I figured out that this format was compatible with the audio player since this was a long time ago, but there is a fuller explantation of data URLs in general below.

1 Like

I got the API working but im having issues filtering the voice names to go with the selected language codes. How do you filter these based on the selected language? TIA

Maybe you could create an option set with the language names and the voices available, or just a database with it…
but the voices are usually like: “en-US-Wavenet-D”… or “fr-FR-Wavenet-A”
You can find the list of voices searching in google’s docs