Hello, I used to use this for my Alexa TTS but the Google Cloud say seems to having some issues with punctuation and saying “#39” for every apostrophe.
Here’s the function node with the random text code
var beg = ["Pardon the interruption, ", "Bossman, ", "Sir, ", "Just a heads up, ", "Sir, I hate to bother you but, ",]
var mid = ["It's almost bed time,", "It's getting late,", "The time for sleep is near,"]
var end = ["and you'd better start winding down", "and the early bird gets the worm", "and you know you will want more sleep in the morning", "and getting a good nights sleep is always a good idea"]
msg.payload =
beg[Math.floor(Math.random() * beg.length)]+
mid[Math.floor(Math.random() * mid.length)]+
end[Math.floor(Math.random() * end.length)]
return msg
It’s passing to a service call node for cloud say TTS
with data as
{
"message": "{{payload}}"
}
Debug for the function node shows the text fine (Top), but the output for the cloud say node is changing all the apostrophes to “'” so that’s what google is saying…
Any ideas on how to fix this? I’m sure it’s something simple, but I can’t seem to figure it out. Used to work fine to Alexa TTS
I’ve basically created all kinds of random speech function nodes like this one over the years so switching to google has broken a lot of my TTS.
Thanks ya’ll!!!